PHP Fatal error: Allowed Memory Size of 20971520 Bytes exhausted (tried to allocate 131072 bytes) in /usr/share/mediawiki/includes/OutputHandler.php on line 81How do I fix this problem?
Ubuntu / Debian PHP5 comes with 16MB php memory limit. Edit /etc/php5/cgi/php.ini,/etc/php5/apache2/php.ini and /etc/php5/cli/php.ini files, run:
sudo vi /etc/php5/cgi/php.ini
sudo vi /etc/php5/cli/php.ini
sudo vi /etc/php5/apache2/php.ini
Set maximum amount of memory (e.g., 128M) a script may consume:
Save and close the file. However, real enforcer is suhosin security patch applied to PHP5. Edit /etc/php5/conf.d/suhosin.ini, run:
memory_limit = 128M
sudo vi /etc/php5/conf.d/suhosin.ini
Set allowed memory size (128M):
suhosin.memory_limit = 128Save and close the file. Note if /etc/php5/conf.d/suhosin.ini file not found, type the following command to install the same, enter:
sudo apt-get install php5-suhosin
Finally, restart the web server:
sudo /etc/init.d/apache2 restart
OR
sudo /etc/init.d/lighttpd restart
No comments:
Post a Comment