Magento Extensions Fixing a Blank White Page in Magento

« Back to Magento Extensions

If you see either a blank white page in Magento or you see some content on the page which suddenly stops, this usually means that a PHP fatal error has occured. A PHP fatal error is an error that PHP cannot recover from and forces PHP to stop what it's doing and exit.

Fixing a blank white page can be very difficult as there no clues as to what could be causing the error. To make this easier, we will tell PHP to reveal the error message by making a small change in our index.php file in Magento. To do this, access your Magento site using FTP (or SFTP/SSH) and edit the index.php file that is in your Magento root. Inside this file, you should see the following line:

#ini_set('display_errors', 1);

At the start of the line you should see the '#' character. This comments out the line and tells PHP to ignore this command. To show error messages in PHP, remove the '#' character from the start of the line and save/upload the file. After we're done fixing the error, you can add the '#' character back in to disable the display of error messages.

If you see the above line without the '#' character, this means that the display of error messages is already enabled for your site. If you don't see this line, it may have been removed by a developer working on your site. If this is the case, simply add it back in anywhere above the Mage::run line.

With error messages now being displayed, let's refresh the page with the error and see what happens.

If previously you had a blank white page, an error message should be displayed on the page that should point you in the right direction to fixing the error. If previously you had some content on the page which abruptly stopped, it is likely that the error message is being hidden by some broken HTML. To view this error, right click the page and select the option to the view the HTML source. When the HTML source code opens up, scroll right to the bottom and you should see the error message.