For bad reasons I need to set memory_limits higher than 1 GB for a directory, but on my PHP 5.2.17 on a Debian 5.0 (Lenny) server when I use, for example, 2048M, I get only the php.ini default value (256M).
PHP runs as an Apache module, and phpinfo gives us (for the directory):
memory_limit 1024M 256M suhosin.memory_limit 0 0
Is there a limitation due to an Apache module, or the PHP configuration? I know the server only has 4 GB of RAM. It's just a special script.
How are you trying to set the memory limit? phpinfo() shows current PHP reserved memory limit, and this is what is available due to php.ini having that set as a memory limit.
Writing this to the Apache .htaccess file in your script directory might work if your server supports setting PHP commands through .htaccess:
php_value memory_limit 2048M
Since it may be possible that .htaccess commands for setting PHP values are turned off. Then you can also try this from PHP code:
ini_set('memory_limit', '2048M');
If this doesn't work and .htaccess also doesn't work, then you need to contact the server administrators.
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