I have a PHP script on a Linux server that I am executing via command line like so: php script.php
(note that it's not being executed as part of a web request).
The memory_limit
in the server's "php.ini" file is set to "512M", and I have verified this as follows:
# echo "<?php phpinfo(); ?>" | php | grep memory_limit
memory_limit => 512M => 512M
Now, the issue is that when I execute the script in question via php script.php
, eventually I get the following error:
Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 600283 bytes) in ...
268435456 bytes ~= 268mb, which is definitely lower than 512mb
What could be happening here? Is it possible there is another system-level setting I am missing? Or are php processes intrinsically limited to ~ 268mb?