I have an problem increasing memory limit for PHP as Apache module.
If I put following directive in Apache configuration, that work OK:
php_value memory_limit 1.99G
But over 2GB do not work, it's restore this value back to 128MB.
What is the problem here? I need more memory for some PDF related tasks.
Server is Debian 2.6.32-5-amd64 #1 SMP, PHP 5.3.3-7+squeeze13 with 12GB physical RAM.
To increase the PHP memory limit setting, edit your PHP. ini file. Increase the default value (example: Maximum amount of memory a script may consume = 128MB) of the PHP memory limit line in php. ini.
Increasing the PHP memory limit The default memory limit is 256M and this is usually more than sufficient for most needs. If you need to raise this limit, you must create a phprc file.
PHP doesn't free memory during script execution so your memory limit needs to be as high as the most memory one script will consume. If the most a script will ever consume is 2MB then set it to 2MB but if you need 780MB then set it to that. We have large production systems with the memory limit set over 2GB.
Have you tried using the value in MB ?
php_value memory_limit 2048M
Also try editing this value in php.ini
not Apache.
I would suggest you are looking at the problem in the wrong light. The questtion should be 'what am i doing that needs 2G memory inside a apache process with Php via apache module and is this tool set best suited for the job?'
Yes you can strap a rocket onto a ford pinto, but it's probably not the right solution.
Regardless, I'll provide the rocket if you really need it... you can add to the top of the script.
ini_set('memory_limit','2048M');
This will set it for just the script. You will still need to tell apache to allow that much for a php script (I think).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With