PHP $_env variables
$_env is an array that contains server-side environment variables. It is a super global variable in PHP, and we can access it directly from anywhere in the PHP program.
$_ENV just passively accepts server-side environment variables and transforms them into array elements that you can try to print directly:
Print_r ($_ENV);
is limited to space, where the printed results are no longer listed, and the results printed on different servers may be completely different.
$_env array elements
The elements in the $_ENV array (array cells) vary greatly with the server environment, so the complete list cannot be listed as $_server. The following are the more common elements that the $_env array contains:
$_server[' path ': Environment variable path.
$_server[' CLASSPATH ': System CLASSPATH path.
$_server[' lib ': System LIB Library path.
$_server[' include ': System include path, note the PHP contains the path is not the same.
$_server[' OS ': Operating system type.
$_server[' LANG ': System language, such as en_US or ZH_CN.
$_server[' PWD ']: Current working directory.
$_server[' temp ']: System TEMP path.
$_server[' ap_parent_pid ': The current process ID number.
$_server[' number_of_processors ': Number of system CPUs.
The reason and solution of the empty $_env
If the printout $_env is empty, you can check the configuration of the php.ini:
Variables_order = "Egpcs"
The above configuration represents the source and order of external variables accepted by PHP, EGPCS is the abbreviation for environment, Get, Post, Cookies, and server. If E is missing from Variables_order's configuration, then PHP cannot accept the environment variable, then $_env is empty.
Original address: http://www.5idev.com/p-php_env.shtml
http://www.bkjia.com/PHPjc/478499.html www.bkjia.com true http://www.bkjia.com/PHPjc/478499.html techarticle PHP $_env variable $_env is an array that contains server-side environment variables. It is a super global variable in PHP, and we can access it directly from anywhere in the PHP program. $_env only ...