-
track_vars
boolean
-
If enabled, then Environment, GET, POST, Cookie, and Server
variables can be found in the global associative arrays
$_ENV,
$_GET,
$_POST,
$_COOKIE, and
$_SERVER.
Note that as of PHP 4.0.3, track_vars
is always turned on.
-
arg_separator.output
string
-
The separator used in PHP generated URLs to separate arguments.
-
arg_separator.input
string
-
List of separator(s) used by PHP to parse input URLs into variables.
Note:
Every character in this directive is considered as separator!
-
variables_order
string
-
Sets the order of the EGPCS (Environment,
Get, Post,
Cookie, and Server) variable
parsing. For example, if variables_order
is set to "SP" then PHP will create the
superglobals $_SERVER and
$_POST, but not create
$_ENV, $_GET, and
$_COOKIE. Setting to "" means no
superglobals will be set.
If the deprecated
register_globals
directive is on, then variables_order also
configures the order the ENV,
GET, POST,
COOKIE and SERVER variables
are populated in global scope. So for example if variables_order
is set to "EGPCS", register_globals is enabled,
and both $_GET['action'] and
$_POST['action'] are set, then
$action will contain the value of
$_POST['action'] as P comes
after G in our example directive value.
Warning
In both the CGI and FastCGI SAPIs,
$_SERVER is
also populated by values from the environment; S
is always equivalent to ES regardless of the
placement of E elsewhere in this directive.
Note:
The content and order of
$_REQUEST is also
affected by this directive.
-
request_order
string
-
This directive describes the order in which PHP registers GET, POST
and Cookie variables into the _REQUEST array. Registration is done
from left to right, newer values override older values.
If this directive is not set, variables_order is used for
$_REQUEST contents.
Note that the default distribution php.ini files does not contain
the 'C' for cookies, due to security concerns.
-
auto_globals_jit
boolean
-
When enabled, the SERVER and ENV variables are created when they're
first used (Just In Time) instead of when the script starts. If these
variables are not used within a script, having this directive on will
result in a performance gain.
The PHP directives
register_globals,
register_long_arrays,
and register_argc_argv
must be disabled for this directive to have any affect. Since PHP
5.1.3 it is not necessary to have register_argc_argv disabled.
Warning
Usage of SERVER and ENV variables is checked during the compile time
so using them through e.g. variable variables will
not cause their initialization.
-
register_globals
boolean
-
Whether or not to register the EGPCS (Environment, GET,
POST, Cookie, Server) variables as global variables.
As of » PHP 4.2.0,
this directive defaults to off.
Please read the security chapter on
Using register_globals
for related information.
Please note that register_globals
cannot be set at runtime (ini_set()). Although, you can
use .htaccess if your host allows it as described
above. An example .htaccess entry:
php_flag register_globals off
.
Note:
register_globals
is affected
by the variables_order
directive.
Warning本特性已自
PHP 5.3.0 起废弃并将自 PHP 5.4.0
起移除。
-
register_argc_argv
boolean
-
Tells PHP whether to declare the argv & argc variables
(that would contain the GET information).
See also command line.
-
register_long_arrays
boolean
-
Tells PHP whether or not to register the deprecated long
$HTTP_*_VARS type
predefined
variables. When On (default), long predefined PHP
variables like $HTTP_GET_VARS will be defined.
If you're not using them, it's recommended to turn them off,
for performance reasons. Instead, use the superglobal arrays,
like $_GET.
This directive became available in PHP 5.0.0.
Warning本特性已自
PHP 5.3.0 起废弃并将自 PHP 5.4.0
起移除。
-
enable_post_data_reading
boolean
-
Disabling this option causes $_POST and
$_FILES not to be populated.
The only way to read postdata will then be through the
php://input stream wrapper.
This can be useful to proxy requests or to process
the POST data in a memory efficient fashion.
-
post_max_size
integer
-
Sets max size of post data allowed. This setting also affects
file upload. To upload large files, this value must be larger
than upload_max_filesize.
If memory limit is enabled by your configure script, memory_limit also affects
file uploading. Generally speaking,
memory_limit should be
larger than
post_max_size
.
当使用 integer
时, 其值以字节来衡量。还可以使用在FAQ中描述的速记符。
If the size of post data is greater than post_max_size, the
$_POST and $_FILES
superglobals
are empty. This can be tracked in various ways, e.g. by passing the
$_GET variable to the script processing the data,
i.e. <form action="edit.php?processed=1">,
and then checking if $_GET['processed'] is set.
Note:
PHP allows shortcuts for bit values, including K (kilo), M (mega)
and G (giga). PHP will do the conversions automatically if you
use any of these. Be careful not to exceed the 32 bit signed integer
limit (if you're using 32bit versions) as it will cause your script
to fail.
-
gpc_order
string
-
Set the order of GET/POST/COOKIE variable parsing. The
default setting of this directive is "GPC". Setting this to
"GP", for example, will cause PHP to completely ignore cookies
and to overwrite any GET method variables with POST-method
variables of the same name.
Note:
This option is not available in PHP 4.
Use variables_order
instead.
-
auto_prepend_file
string
-
Specifies the name of a file that is automatically parsed
before the main file. The file is included as if it was
called with the require function, so
include_path is used.
The special value none
disables auto-prepending.
-
auto_append_file
string
-
Specifies the name of a file that is automatically parsed
after the main file. The file is included as if it was
called with the require function, so
include_path is used.
The special value none
disables auto-appending.
Note:
If the script is terminated with exit(),
auto-append will not occur.
-
default_mimetype
string
-
-
default_charset
string
-
PHP always outputs a character encoding by default in
the Content-type: header. To disable sending of the charset, simply
set it to be empty.
-
always_populate_raw_post_data
boolean
-
Always populate the $HTTP_RAW_POST_DATA containing
the raw POST data. Otherwise, the variable is populated only with
unrecognized MIME type of the data. However, the preferred method for
accessing the raw POST data is php://input.
$HTTP_RAW_POST_DATA is not available with
enctype="multipart/form-data".
-
allow_webdav_methods
boolean
-
Allow handling of WebDAV http requests within PHP scripts (eg.
PROPFIND, PROPPATCH, MOVE, COPY, etc.).
This directive does not exist as of PHP 4.3.2.
If you want to get the post data of those requests, you have to
set
always_populate_raw_post_data as well.