PHP: settings memory_limits > 1024M does not work

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.

Leave a Comment