Tuesday, September 30, 2014

PHP: Fatal Error: Allowed Memory Size of X Bytes Exhausted

In case Ganglia's web page is unreachable while Apache is working, check Apache's error log for the following error:
PHP: Fatal Error: Allowed Memory Size of XXXXXX Bytes Exhausted
To solve this, we need to increase the size limit by using the following command:
## XXXM or -1 to set no limit at all.
sed -i 's/memory_limit.*/memory_limit = 512M/g' /etc/php.ini
OR
sed -i 's/memory_limit.*/memory_limit = -1/g' /etc/php.ini

No comments:

Post a Comment