P粉3121957002023-08-28 16:05:35
ini_set('memory_limit', '128M');
or
php.ini => memory_limit = 128M
or
php_value memory_limit 128M
P粉4457509422023-08-28 13:27:06
PHP configuration can be set in multiple places:
php.ini
(usually somewhere in /etc)php_value
) php.ini
(use the command php -i | grep memory_limit
to check the CLI configuration)php_value
)ini_set()
)In the output of PHPinfo, the "Master" value is the compiled default value, and the "Local" value is the actual effective value. It can be left unchanged from the default value or overridden in any of the above locations.
Also note that PHP typically has different .ini files for command line and web server-based operations. Checking phpinfo()
from the command line will report different values than running it in a web-based script.