I have a big php script that needs a gigabyte or more to run. I set the memory_limit in php.ini to 2048M. If I echo the limit with ini_get, I get the 2048M as expected. But when I run the script it fails and says that it could only allocate 512mb. I have 16GB of ram on the server, so its not that. There must be another limit set somewhere..?
feedback
|
migrated from stackoverflow.com Mar 13 '11 at 19:45
This question came from our site for professional and enthusiast programmers.
|
PHP, Webserver processes are also limited by the per process max memory limit. You'll have to ask an administrator to change the limit in this case. On linux/unix, you can check the limit with the following command in the shell:
or use PHP to check:
| |||||
feedback
|
|
Don't know about any apache limits but I do know Linux supports setting resource limits for processes. Can't remember the exact details but one command involved is ulimit. | |||
|
feedback
|