User:Margarett/What the white screen of death means From Online Manual

Jump to: navigation, search

What is the White Screen of Death

A white screen when opening a page in SMF (or in any other PHP-based application) means that an irrecoverable error occurred, which caused the execution of the script to be halted before any content is outputted to your browser.

There are mainly two reasons for this to happen. The first is that there is a PHP error in the code of your forum (which you might get if you are performing changes in the code, installing a MOD, etc). The second is that PHP cannot use the necessary memory for the task being requested.

Why do I see a white page and not the error itself?

In short: your PHP configuration prevents that to happen. In a live and fully functional web site your guests aren't expected to see errors (if they occur) which might reveal file paths or other sensible information, which a meaningful error information should actually display. For this reason, some hosts specifically configure PHP to not show errors on screen.

How to Get More Information

There are several ways to get more information. We present you some of them but please be aware that they might not exist in your specific server configuration.

Contact your Host

Assuming you don't run your own server, contacting your host is the easiest way to get information. Your host should have access to all your logs so they should be able to give you detailed information. This is, however, a slow process because you need to wait for their reply.

Check your Logs

When a PHP error occurs, it is logged in a file in your server's hard drive. Depending on your configuration, you should have that file also in your home directory. Use your FTP client and search for a file which is usually called "error_log", "error.log" (or variations of this). If you don't find such file, that's because your server is not configured to create it. Contact your host and ask them to enable this option as it is a very helpful debug tool.

Try to Output More Information

It is possible to tell PHP to output the error information directly to your browser. To do so, edit SMF's index.php (make sure you create a backup) with your favourite text editor and find:


// Get everything started up...
define('SMF', 1);

Replace with:


error_reporting(E_ALL);
ini_set('display_errors', 1);

// Get everything started up...
define('SMF', 1);

After you fix the underlying problem you should revert this change.

How to Solve the Problem

How to solve the problem depends specifically on what the problem is. The most common causes are:

PHP Code Errors

You should only see these errors when you are editing your forum's code or when installing/uninstalling MODs. Your log should tell you something like (these are just examples!):

Parse error: syntax error, unexpected $end in /home/user/public_html/forum/index.php on line 175
Fatal error: Call to undefined function getInitialInformation() in /home/user/public_html/forum/index.php on line 175

(error, file name, file path and and line number might of course vary)

PHP Memory Errors

This error occurs when the code execution tries to allocate more memory than the system is configured to grant. Your log should tell you something like:

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 826064718 bytes) in /home/user/public_html/forum/index.php on line 175

(memory quantities, file name, file path and and line number might of course vary)


Ask us for Support

Please ask us for support by posting in appropriate support board for the version of SMF your forum uses. Please make sure you provide us a [1] with your request.



Advertisement: