PHP's config can be set in multiple places:
- master system
php.ini
(usually in /etc somewhere)
- somewhere in Apache's configuration (httpd.conf or a per-site .conf file, via
php_value
)
- CLI & CGI can have a different
php.ini
(use the command php -i | grep memory_limit
to check the CLI conf)
- local .htaccess files (also
php_value
)
- in-script (via
ini_set()
)
In PHPinfo's output, the "Master" value is the compiled-in default value, and the "Local" value is what's actually in effect. It can be either unchanged from the default, or overridden in any of the above locations.
Also note that PHP generally has different .ini files for command-line and webserver-based operation. Checking phpinfo()
from the command line will report different values than if you'd run it in a web-based script.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…