PHP script execution exceeds the memory limit, although the limit is higher
I have a PHP script on a Linux server that I am executing using the command line like this: PHP .php
(note that it is not executed as part of a web request).
The file memory_limit
on the server "php.ini" has "512M" set and I checked it like this:
# echo "<?php phpinfo(); ?>" | php | grep memory_limit
memory_limit => 512M => 512M
Now the problem is that when I run the script through PHP .php
, over time I get the following error:
Fatal error: Allowed memory size 268435456 bytes exhausted (tried to allocate 600283 bytes) in ...
268435456 bytes ~ = 268mb, which is definitely below 512mb
What could be here? Is it possible that there is another system layer I am missing? Or php processes are inherently limited to ~ 268mb?
source to share