I need to run a PHP CLI script and give it a lot of memory (this is an automatic documentation generator that should cover a large code base). I have a powerful machine and allocated 5 GB for php, both in php.ini and in the ini_set('memory_limit','5120M') built-in declaration ini_set('memory_limit','5120M') in the script file.
If I add these lines to the top of the script:
phpinfo(); exit();
... he claims to have a 5120M memory limit, as I pointed out.
But the script still throws an error saying
Fatal error: Allowed memory size of 1073741824 bytes exhausted
... which is 1 GB, not 5 GB, as I indicated.
Is there another place the script might look to determine its memory limit? This works on Fedora Linux.
(Yes, the final solution may be to rewrite the script to be more efficient, but I did not write it in the first place, so before resorting to this, I just want to throw resources on it and see if this works.)
source share