Php. ini core configuration options

Source: Internet
Author: User
Tags http file upload
The php. ini core configuration option indicates that the list only contains the core php. ini configuration options. The extension configuration options are described on the document pages of each extension. The session options can be found on the sessions page. Httpd options table G-3.Httpd option name default value modifiable range update record async_send0PHP_INI_ALL language options table G-4 php. ini core configuration option description

This list only contains the core php. ini configuration options. The extension configuration options are described on the document pages of each extension. The session options can be found on the sessions page.

Httpd option
Tables G-3. Httpd options

The default name can modify the range update record.
Async_send "0" PHP_INI_ALL

Language options
Table G-4. Language and miscellaneous configuration options

The default name can modify the range update record.
Short_open_tag "1" PHP_INI_PERDIR is PHP_INI_ALL in PHP <= 4.0.0.
Asp_tags "0" PHP_INI_PERDIR is PHP_INI_ALL in PHP <= 4.0.0.
Precision "14" PHP_INI_ALL
Y2k_compliance "1" PHP_INI_ALL
Allow_call_time_pass_reference "1" PHP_INI_PERDIR is PHP_INI_ALL in PHP <= 4.0.0.
Expose_php "1" can only be configured in php. ini.
Zend. ze1_compatibility_mode "0" PHP_INI_ALL is available from PHP 5.0.0.

The following is a brief explanation of configuration options.

Short_open_tag boolean
Determine whether to allow the abbreviated form of the start sign of the PHP code ( ). If you want to use PHP with XML, disable this option for embedded use. . Otherwise, it can be output through PHP, for example: . If disabled, you must use the complete form of the PHP code start flag ( ).

Note: This instruction will also affect the abbreviated form

Asp_tags boolean
Except for the common ASP-style flag is also allowed <%>. This also includes the abbreviation of the output variable value <% = $ value %>. For more information, see the separation section from HTML.

Note: ASP style labels are newly added in version 3.0.4.

Precision integer
The number of digits in a floating point.

Y2k_compliance boolean
Force 2000 compatibility (problems may occur in incompatible browsers ).

Allow_call_time_pass_reference boolean
Whether to enable the force parameter to be passed by reference when the function is called. This method is no longer supported in PHP/Zend versions. We recommend that you specify which parameters should be passed by reference in the function definition. We encourage you to disable this option and ensure that the script runs properly to ensure that the script can run in future versions. (each time you use this feature, you will receive a warning, parameters are passed by value rather than by reference ).

It is not recommended to pass parameters by reference during function calling because it affects code cleanliness. If the parameter of a function is not declared as a reference, the function can modify its parameter without writing the document. To avoid its side effects, it is best to specify the parameter only when the function declaration needs to be passed through reference.

For more information, see references.

Expose_php boolean
Decide whether to expose PHP to be installed on the server (for example, adding the signature to the Web server information header ). Without any security threats, the client can only know whether PHP is installed on the server.

Zend. zemo-compatibility_mode boolean
Enable Zend Engine 1 (PHP 4) compatibility mode. This affects object replication, construction, and comparison.

See porting from PHP 4 to PHP 5.

Resource Restrictions
Table G-5. resource limits

The default name can modify the range update record.
Memory_limit "8 M" PHP_INI_ALL

The following is a brief explanation of configuration options.

Memory_limit integer
This command sets the maximum number of memory bytes that a script can apply. This helps prevent poorly written scripts from consuming the available memory on the light server. To use this command, it must be activated during compilation. Therefore, the configure row should include: -- enable-memory-limit. If you do not need any memory restrictions, you must set it to-1.

Starting from 4.3.2, when memory_limit is activated, the PHP function memory_get_usage () can be used.

When the integer type is used, the value is measured in bytes. You can also use simplified symbols. For more information, see this FAQ.

See also: max_execution_time.

Data processing
Table G-6. Data processing configuration options

The default name can modify the range update record.
Track_vars "On" PHP_INI _??
Arg_separator.output "&" PHP_INI_ALL is available from PHP 4.0.5.
Arg_separator.input "&" PHP_INI_PERDIR is available from PHP 4.0.5.
Variables_order "EGPCS" PHP_INI_ALL
Auto_globals_jit "1" PHP_INI_PERDIR is available from PHP 5.0.0.
Register_globals "0" PHP_INI_PERDIR is PHP_INI_ALL in PHP <= 4.2.3.
Register_argc_argv "1" PHP_INI_PERDIR is PHP_INI_ALL in PHP <= 4.2.3.
Register_long_arrays "1" PHP_INI_PERDIR is available from PHP 5.0.0.
Post_max_size "8 M" PHP_INI_PERDIR is PHP_INI_ALL in PHP <= 4.2.3. Available from PHP 4.0.3.
Gpc_order "GPC" PHP_INI_ALL
Auto_prepend_file NULL PHP_INI_PERDIR is PHP_INI_ALL in PHP <= 4.2.3.
Auto_append_file NULL PHP_INI_PERDIR is PHP_INI_ALL in PHP <= 4.2.3.
Default_mimetype "text/html" PHP_INI_ALL
Default_charset "" PHP_INI_ALL
Always_populate_raw_post_data "0" PHP_INI_PERDIR is PHP_INI_ALL in PHP <= 4.2.3. Available from PHP 4.1.0.
Allow_webdav_methods "0" PHP_INI_PERDIR

The following is a brief explanation of configuration options.

Track_vars boolean
If activated, the environment variables, GET, POST, Cookie, and Server variables can be found in the global join array: $ _ ENV, $ _ GET, $ _ POST, $ _ COOKIE and $ _ SERVER.

Note that track_vars is always enabled since PHP 4.0.3.

Arg_separator.output string
The separator used to separate parameters in the URL generated by PHP.

Arg_separator.input string
PHP parses the URL into a variable separator list.

Note: each character in this command is used as a separator!

Variables_order string
Set the parsing sequence of EGPCS (Environment, GET, POST, Cookie, Server) variables. The default value is "EGPCS ". For example, setting it as "GP" will cause PHP to completely ignore the environment variables, cookies and server variables, and overwrite the variable of the same name in the POST method with the GET method variables.

See register_globals.

Auto_globals_jit boolean
After it is enabled, the SERVER and ENV variables are created after they are used for the first Time (Just In Time), instead of waiting for the script to start running. If these variables are not always used in the script, enabling this variable will improve the server performance.

To make this option valid, the PHP configuration options register_globals, register_long_arrays, and register_argc_argv must be disabled.

Register_globals boolean
Determine whether to register EGPCS (Environment, GET, POST, Cookie, Server) variables as global variables.

Starting from PHP 4.2.0, this option is off by default.

For more information, see use register_globals in the security Chapter.

Please note that register_globals cannot be set at runtime (ini_set (), although. htaccess can be used when the host is allowed as described above. Example of a. htaccess project: php_flag register_globals off.

Note: register_globals is affected by the variables_order option.

Register_argc_argv boolean
Determines whether PHP defines the argv & argc variable (may contain GET information ).

For more information, see command line. In addition, this option is available from PHP 4.0.0 and is always "On" before ".

Register_long_arrays boolean
Set whether PHP registers predefined variables such as $ HTTP _ * _ VARS that are out of date. If it is On (default), PHP variables like $ HTTP_GET_VARS will be registered. If this option is not used, we recommend that you disable this option for performance considerations, instead of using an ultra-global array, such as $ _ GET.

This command is available from PHP 5.0.0.

Post_max_size integer
Set the maximum size allowed for POST data. This setting also affects file upload. To upload a large file, the value must be greater than upload_max_filesize.

If the memory limit is activated in the configuration script, memory_limit also affects file upload. Generally, memory_limit should be larger than post_max_size.

When the integer type is used, the value is measured in bytes. You can also use simplified symbols. For more information, see this FAQ.

If the size of the POST data is greater than post_max_size $ _ POST and $ _ FILES superglobals, it is null. This can be proved in multiple ways, for example, passing the $ _ GET variable to the script to process data, that is

And check whether $ _ GET ['processed'] is set.

Gpc_order string
Set the order of GET/POST/COOKIE variable parsing. the default value is "GPC ". For example, setting it as "GP" will cause PHP to ignore the cookie variable completely and overwrite the variable of the same name in the POST method with the GET method variable.

Note: This option cannot be used in PHP 4. Replace it with variables_order.

Auto_prepend_file string
Specifies the file name automatically parsed before the main file. This file is included just like calling the include () function, so the include_path is used.

The automatic prefix is disabled for the special value none.

Auto_append_file string
Specifies the file name automatically parsed after the master file. This file is included just like calling the include () function, so the include_path is used.

The automatic suffix is disabled for the special value none.

Note: If the script is terminated through exit (), the automatic suffix will not occur.

Default_mimetype string
Default_charset string
From 4.0b4, PHP always outputs the character encoding in the Content-type: header of the HTTP information by default. To disable the sending character set, set this option to null.

Always_populate_raw_post_data boolean
Always generate the $ HTTP_RAW_POST_DATA variable containing the original POST data. Otherwise, this variable is generated only when data of the unrecognized MIME type is encountered. However, a better way to access the original POST data is php: // input. $ HTTP_RAW_POST_DATA is unavailable for enctype = "multipart/form-data" form data.

Allow_webdav_methods boolean
Allows you to process WebDAV HTTP requests (such as PROPFIND, PROPPATCH, MOVE, and COPY) in PHP scripts ). This option does not exist after PHP 4.3.2. If you want to obtain the POST data of these requests, you must also set always_populate_raw_post_data.

See magic_quotes_gpc, magic-quotes-runtime, and magic_quotes_sybase.

Path and Directory
Table G-7. path and directory configuration options

The default name can modify the range update record.
Include_path ".;/path/to/php/pear" PHP_INI_ALL
Doc_root NULL PHP_INI_SYSTEM
User_dir NULL PHP_INI_SYSTEM
Extension_dir "/path/to/php" PHP_INI_SYSTEM
Cgi. fix_pathinfo "1" PHP_INI_ALL
Cgi. force_redirect "1" PHP_INI_ALL
Cgi. redirect_status_env NULL PHP_INI_ALL
Fastcgi. impersonate "0" PHP_INI_ALL
Cgi. rfc2616_headers "0" PHP_INI_ALL

The following is a brief explanation of configuration options.

Include_path string
Specify a set of directories for the require (), include (), and fopen_with_path () functions to find files. The format is similar to the system PATH environment variables: A list of directories, separated by colons in UNIX, and separated by semicolons in Windows.

Example G-1. Unix export de_path

Include_path = ".:/php/shortdes"


Example G-2. Windows export de_path

Include_path = ".; c:/php/shortdes"


You can use it in the include path to allow relative paths, which represent the current directory.

Doc_root string
The root directory of PHP on the server. It is used only when it is not null. If PHP is configured in safe mode, files outside the directory will not be parsed. If FORCE_REDIRECT is not specified during PHP compilation and PHP is run in CGI mode on any web server (except IIS), set doc_root. The alternative is to use the following cgi. force_redirect configuration options.

User_dir string
Use the basic directory name of the PHP file under the user directory, for example, public_html.

Extension_dir string
PHP is used to find the directory for dynamically connecting to the extension Library. See enable_dl and dl ().

Extension string
Dynamic connection to the extension library loaded when PHP is started.

Cgi. fix_pathinfo boolean
CGI is supported by true PATH_INFO/PATH_TRANSLATED. In the past, PHP set PATH_TRANSLATED to SCRIPT_FILENAME, regardless of what PATH_INFO is. For more information about PATH_INFO, see cgi specifications. Setting this value to 1 will make php cgi correct its path to conform to the specification. Setting 0 will make PHP behave the same way as before. The default value is zero. You should correct the script to use SCRIPT_FILENAME instead of PATH_TRANSLATED.

Cgi. force_redirect boolean
It is necessary to use CGI. force_redirect to provide security when running PHP in cgi mode on most web servers. By default, PHP is On. You can disable it at your own risk.

Note: Windows users can disable IIS securely. In fact, this is required. To use it under OmniHTTPD or Xitami, you must also disable it.

Cgi. redirect_status_env string
If cgi is enabled. force_redirect, not running under Apache or Netscape (iPlanet) web server, may need to set an environment variable name, PHP will look for it to know it can continue to execute.

Note: setting this variable may cause security problems. First, you must know what you are doing.

Fastcgi. impersonate string
FastCGI in IIS (on WINNT-based operating systems) supports the ability to mimic client security tokens. This allows IIS to define the security context of the request based on the runtime. Mod_fastcgi in Apache does not support this feature (03/17/2002 ). If it is run in IIS, set it to 1. The default value is 0.

Cgi. rfc2616_headers int
Specifies the header used by PHP when sending the HTTP response code. If it is set to 0, PHP sends a Status: header, which is supported by Apache and other web servers. If this option is set to 1, PHP sends an RFC 2616-compatible header. Keep the value 0 unless you know what you are doing.

File Upload
Table G-8. file upload configuration options

The default name can modify the range update record.
File_uploads "1" PHP_INI_SYSTEM is PHP_INI_ALL in PHP <= 4.2.3. Available from PHP 4.0.3.
Upload_tmp_dir NULL PHP_INI_SYSTEM
Upload_max_filesize "2 M" PHP_INI_PERDIR is PHP_INI_ALL in PHP <= 4.2.3.

The following is a brief explanation of configuration options.

File_uploads boolean
Whether to allow HTTP File upload. See the upload_max_filesize, upload_tmp_dir, and post_max_size commands.

When the integer type is used, the value is measured in bytes. You can also use simplified symbols. For more information, see this FAQ.

Upload_tmp_dir string
Temporary directory for storing files during File upload. It must be a directory that can be written by the PHP process owner. If this parameter is not specified, PHP uses the default value.

Upload_max_filesize integer
The maximum size of the uploaded file.

When the integer type is used, the value is measured in bytes. You can also use simplified symbols. For more information, see this FAQ.

Common SQL
Table G-9. common SQL configuration options

The default name can modify the range update record.
SQL. safe_mode "0" PHP_INI_SYSTEM

The following is a brief explanation of configuration options.

SQL. safe_mode boolean
Debugger configuration options
Note:
Only PHP 3 implements a default debugger. For more information, see Appendix E.

Debugger. host string
The DNS name or IP address of the host used by the debugger.

Debugger. port string
The port number used by the debugger.

Debugger. enabled boolean
Whether to enable the debugger.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.