Increase memory limit for single PHP page

Some time we do receive the “memory limit” exceeded error message while browsing the php script and we can’t increase the memory limit in the php.ini file at that time, we can add the following code in the php page under which you are facing the “memory limit” error message. For example if you are receiving the “memory limit” error message in the test.php page than add the following code in the beginning of test.php file.

ini_set(“memory_limit”,”24M”);

The above code will increase the memory limit from the default php memory limit value to the new memory limit value 24M.

About Anant 386 Articles
Senior technical writer