Skip to main content

Posts

Showing posts with the label apache

How to fix a PHP Fatal error: Allowed memory size of XXXXX bytes exhausted

If you're working with a PHP website, Magento in my case, and you get a page that is half blank when loading it's possible that you're experiencing a fatal PHP error.  This quick post will show you how to fix this in Magento 1.6.1.0. Overview Verify that you're getting a fatal PHP error related to memory size Update your .htaccess file Update your php.ini configuration Step 1:   Verify the error To verify that you are experiencing a fatal PHP error related to the memory size available you must first find your PHP error log file.  My host provides this through cPanel but if you're using your own Apache server it can usually be found in /var/logs/apache2/errors.log (see below). Open using whatever editor you like (geany in my case), when opened, I was seeing this: Apache2 error.log file showing a PHP Fatal error My log was giving this error: [23-Nov-2011 17:13:12] PHP Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to all