- Forums
- PHP
- Fatal Error: Php Allowed Memory Size Exhausted
Will Show You How To Fix Fatal Error: Php Allowed Memory Size Exhausted Error Message On Your Php [2095], Last Updated: Mon Jun 24, 2024
Webune Support
Sat Feb 13, 2010
0 Comments
731 Visits
if you ever have gotten this error messsage on your php scripts that say:
Fatal Error: PHP Allowed Memory Size Exhaustedhow do you fix this: its easy.
if you have a linux dedicated server with Webune, login to your server with super user and send this command to open the php.ini file:
SHELL COMMAND:
nano /etc/php.ini
look for this lines:
max_execution_time = 30 ; Maximum execution time of each script, in seconds
max_input_time = 60 ; Maximum amount of time each script may spend parsing request data
memory_limit = 16M ; Maximum amount of memory a script may consume
now change memory_limit = 16M to whatever you want
for example: memory_limit = 32M
now you can restart your server to apply the changes:
SHELL COMMAND:
/etc/init.d/httpd restart
we also have other post that will show 3 different ways on how you can increase the php memory limit and also explain when you should use them. but you need to be careful when you make these changes, so always make a backup copy of the original php.ini file before making any changes
NOTE: if you dont have access to the php.ini file, you can still apply these settings by putting this code in your script
PHP CODE:
ini_set('memory_limit', '64M');
NOTE: you must put this at the beginning of your script to work