Home  >  Article  >  Backend Development  >  php.ini configuration detailed options_PHP tutorial

php.ini configuration detailed options_PHP tutorial

WBOY
WBOYOriginal
2016-07-15 13:23:24833browse

php.ini 或 php3.ini 是 PHP 在启动时会读取的配置文件。该文件的存放路径为 /usr/local/lib/。在 PHP 3.x 版的配置文件为 php3.ini;而在 PHP 4.x 版改为 php.ini。若 PHP 安装成服务器的模块,则在 Web 服务器启动执行时会读取,之后就不再读取,因此改动配置的话要重新启动 Web 服务器。若使用独立 PHP CGI 方式,则每次都读一次。

要看目前的系统配置,可以用phpinfo()看到。以下为选项配置

php_value name value 配置变量名称和值。本选项需 PHP 4.x 版之后才能使用。

php_flag name on|off 配置标志布尔变量选项。本选项需 PHP 4.x 版之后才能使用。

php_admin_value name value 配置 Apache 的配置文件变量。原来在 .htaccess 的配置改到这个选项配置。本选项需 PHP 4.x 版之后才能使用。

php_admin_flag name on|off 配置布尔变量当标志。本选项需 PHP 4.x 版之后才能使用。

asp_tags boolean 配置 PHP 程序是否解析以 ASP Script 语法 的标记 (tag)。本选项在 PHP 3.0.4 之后才可使用。更多的细节可以参考>嵌入方法的部份。

auto_append_file string 配置本选项可以让指定的文件附加在原 PHP 程序后面自动执行。若 PHP 程序中有用到 exit() 函数,则指定的文件不会执行。参数 string 即为指定自动执行的文件。

auto_prepend_file string 配置本选项可以让指定的文件在原 PHP 程序之前自动执行。参数 string 即为指定自动执行的文件。

cgi_ext string 本选项配置 CGI 程序的扩展名。

display_errors boolean 本选项配置是否要将执行的错误信息显示在用户的浏览器上。

doc_root string 配置服务器的文件及 PHP 文件放置的根目录。

engine boolean 本选项需要使用apache的模块方式使用 PHP。可配置是否要使用 PHP 引擎。在 httpd.conf 中加入 php3_engine on/off 亦可配置某目录或某虚拟网站是否要用 PHP 解析器。

error_log string 本选项用来配置错误记录文件。在 UNIX 系统上参数 string 即为文件名。Windows NT 会将记录记在事件检视器的日志之中。Windows 95/98 则不支持系统记录。

error_reporting integer 本选项用来配置系统记录的等级。参数 integer 即为等级的级数标志,可以加在一起,默认值为 7,见下表
 
级数 说明
1 一般的错误
2 一般的警告
4 解析错误
8 非关键的警告

open_basedir string This option is used to configure the lowest-level directory that provides PHP access. PHP programs can only access files or directories under the specified directory. Using this option is mainly for system security considerations. The parameter string is the lowest directory node to be restricted. It is worth noting that in UNIX systems, if the files or directories under the node have symbolic links, the purpose of using this option may be compromised. Therefore, it is also important for Webmaster to consider the design of the directory. Task. The default value is that all files are accessible. After PHP version 3.0.7, multiple underlying directories can be configured.

gpc_order string Configure the order and rules of GET/POST/COOKIE three modules. The parameter string is the rule to be configured. For example: configuring it as "GP" means ignoring cookies and replacing GET with POST when the access method (method) is the same.

ignore_user_abort string The default value is Off. Used to configure whether to continue processing when the client is disconnected when the transmission is not completed.

include_path string is the file search path for functions such as require, include, and fopen_with_path in PHP programs. The direction of the slash is different in UNIX or Windows.

log_errors boolean specifies whether program errors should be recorded in the log file.

magic_quotes_gpc boolean configures the special characters of the three modules of GET/POST/COOKIE, including single quotes, double quotes, backslashes, and null characters (NUL). Whether to automatically Add a backslash when overflowing characters.

magic_quotes_runtime boolean configures whether to automatically add backslashes to the returned data when overflowing characters occur.

magic_quotes_sybase boolean configures single quotes in sybase data to automatically add backslashes as overflow characters.

max_execution_time integer configures the maximum execution time of the program. The unit is seconds.

memory_limit integer configures the maximum amount of memory used by the program.

short_open_tag boolean Configures whether to use short PHP tags ( ?>). If you do not use it, you must use

track_errors boolean Turning on this option allows the final error message to be followed by the global variable $php_errormsg.

track_vars boolean Turning on this option allows the string entered by the user to be automatically parsed into variables without having to handle it yourself.

upload_tmp_dir string specifies the temporary path of the uploaded file.

user_dir string specifies the path to the user's root directory.

warn_plus_overloading boolean If this option is turned on, strings can only be linked with English periods (.), but not with plus signs (+).

SMTP string In Windows series operating systems, it is used to specify the SMTP server for use by the mail function. The parameter string is the SMTP server name.

sendmail_from string configures the "From: " string for the mail function used by Windows series operating systems.

sendmail_path string configures the placement path of the sendmail program. For example /usr/sbin/sendmail.

safe_mode boolean Configures PHP to execute in safe mode.

safe_mode_exec_dir string Configure the path for safe mode program execution.

debugger.host string specifies the remote debugging server name, which can be IP or Domain Name.

debugger.port string Configure the port of the remote debugging server.

debugger.enabled boolean configures whether the debug mode can be used.

enable_dl boolean This option is only valid when using the Apache module. Whether functions used to configure PHP work. When the system is in safe-mode, this option enable cannot use the dl() function.

extension_dir string Configure the path of the dynamic function.

extension string The dynamic extension function to be loaded when PHP starts.

mysql.allow_persistent boolean configures whether to allow persistent connections to the MySQL database, which will affect the function.

mysql.max_persistent integer Configures each handler to maintain up to several MySQL persistent connections.

mysql.max_links integer Configure each handler to open up to several MySQL connections, including persistent connections.

msql.allow_persistent boolean configures whether to allow persistent connections to the mSQL database, which will affect the function.

msql.max_persistent integer Configures each handler to maintain up to several mSQL persistent connections.

msql.max_links integer Configure each handler to open up to several mSQL connections, including persistent connections.

pgsql.allow_persistent boolean configures whether to allow persistent connections to the Postgres database, which will affect the function.

pgsql.max_persistent integer Configures each handler to maintain up to several Postgres persistent connections.

pgsql.max_links integer Configures the maximum number of Postgres connections each handler can open, including persistent connections.

sybase.allow_persistent boolean configures whether to allow persistent connections to the Sybase database (persistent connections), which will affect the function.

sybase.max_persistent integer Configures each handler to maintain a maximum of several Sybase persistent connections.

sybase.max_links integer
Configure each handler to open up to several Sybase connections, including persistent connections.

sybct.allow_persistent boolean configures whether to allow persistent connections to the Sybase-CT database. The default value is open.

sybct.max_persistent integer Configures a maximum of several Sybase-CT persistent connections to be maintained per handler. The default value is -1 for no limit.

sybct.max_links integer Configures the maximum number of Sybase-CT connections each handler can open, including persistent connections. The default value is -1, which means no limit.

sybct.min_server_severity integer Configure the minimum number of Sybase-CT server error reports. The default value is 10.

sybct.min_client_severity integer Configure the minimum number of Sybase-CT client error reports. The default value is 10.

sybct.login_timeout integer Configure the longest login time that Sybase-CT can use. The default value is 1 minute.

sybct.timeout integer Configures the query operation time limit of Sybase-CT. The default value is unlimited.

sybct.hostname string Configures the machine name to which Sybase-CT can connect. The default value is unlimited

ifx.allow_persistent boolean configures whether to allow Informix database persistent connections (persistent connections), which will affect the function.

ifx.max_persistent integer Configures each handler to maintain up to several Informix persistent connections.

ifx.max_links integer Configure each handler to open up to several Informix connections, including persistent connections.

ifx.default_host string configures the server name of Informix's default connection for use by the ifx_connect() or ifx_pconnect() function.

ifx.default_user string configures the user account for Informix's default connection, for use by ifx_connect() or ifx_pconnect( function.

ifx.default_password string Configure the user password for Informix default connection, used by ifx_connect() or ifx_pconnect() function

ifx.blobinfile boolean Configure Informix long bit class mode. , 0 table is in memory; 1 table is in file. You can also use the ifx_blobinfile_mode() function in the PHP program to modify it.

ifx.textasvarchar boolean configures the Informix text mode by default. Value, 0 means return blob code; 1 means return varchar string. You can also use ifx_textasvarchar() function in PHP program to modify the configuration.

ifx.byteasvarchar boolean. Configure the default value of the Informix bit group mode. 0 means returning the blob code; 1 means returning the varchar string. You can also use ifx_byteasvarchar() in the PHP program to modify the configuration. >ifx.charasvarchar boolean configures whether the trailing spaces in the string returned by Informix should be automatically removed

ifx.nullformat boolean configures the return method of the NULL field, true means returning a string. NULL, false table returns the string "". You can also use ifx_nullformat() to modify the decimal point of the BC high-precision function library in the PHP program.

browscap string Configure the browser’s file opening capability name.

uodbc.default_db string Configure ODBC. The database name of the default connection, used by the odbc_connect() or odbc_pconnect() function. () function is used.

uodbc.default_pw string Configure the user password for the ODBC default connection, for use by odbc_connect() or functions.

uodbc.allow_persistent boolean configures whether to allow persistent connections to the ODBC database (persistent connections), which will affect the odbc_pconnect() function.

uodbc.max_persistent integer Configures each handler to maintain up to a few ODBC persistent connections.

uodbc.max_links integer Configures the maximum number of ODBC connections each handler can open, including persistent connections.

The following configuration values ​​related to session are only supported in PHP 4.x and above. In the php.ini configuration file.

session.save_handler defines the file name of session storage data. The default value is files.

session.save_path defines the file path where the session stores data. The default value is /tmp.

session.name configures the cookie name used by the session. The default value is PHPSESSID.

session.auto_start configures whether the session is automatically opened. The default value is 0 (no).

session.lifetime configures the storage time of the cookie after it is sent to the browser, in seconds.The default value is 0, which means until the browser is closed.

session.serialize_handler defines the header of continuous/de-continuous data. This function is only used internally by the WDDX module or PHP. The default value is php.

session.gc_probability configures the garbage collection (gc, garbage collection) processing probability for each request response. The default value is 1.

session.gc_maxlifetime configures the number of seconds to live before waste is cleared.

session.extern_referer_check determines whether the Session code referring to the client should be deleted. Sometimes it is configured not to be deleted due to security or other considerations. The default value is 0.

session.entropy_file configures the session code to be created using an external high-entropy resource or file, such as /dev/random or /dev/urandom on UNIX systems.

session.entropy_length configures the number of bytes the session reads from high-entropy resources. The default value is 0.

session.use_cookies configures whether the session should be turned into a cookie and stored on the client side. The default value is 1, which means this function is turned on.


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/446858.htmlTechArticlephp.ini or php3.ini is the configuration file that PHP will read when it starts. The storage path of this file is /usr/local/lib/. In PHP 3.x version, the configuration file is php3.ini; in PHP 4.x version, it is changed to...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn