Nothing is seen. The page is empty and white.
Also known as the White Page Of Death or White Screen Of Death. This happens when error reporting is turned off and a fatal error (often syntax error) occurred.
If you have error logging enabled, you will find the concrete error message in your error log. This will usually be in a file called "php_errors.log", either in a central location (e.g. /var/log/apache2 on many Linux environments) or in the directory of the script itself (sometimes used in a shared hosting environment).
Sometimes it might be more straightforward to temporarily enable the display of errors. The white page will then display the error message. Take care because these errors are visible to everybody visiting the website.
This can be easily done by adding at the top of the script the following PHP code:
ini_set('display_errors', 1); error_reporting(~0);
The code will turn on the display of errors and set reporting to the highest level.
Since the ini_set() is executed at runtime it has no effects on parsing/syntax errors. Those errors will appear in the log. If you want to display them in the output as well (e.g. in a browser) you have to set the display_startup_errors directive to true. Do this either in the php.ini or in a .htaccess or by any other method that affects the configuration before runtime.
You can use the same methods to set the log_errors and error_log directives to choose your own log file location.
Looking in the log or using the display, you will get a much better error message and the line of code where your script comes to halt.
Related questions:
- PHP's white screen of deathPHP's white screen of death
- White screen of death!White screen of death!
- PHP Does Not Display Error MessagesPHP Does Not Display Error Messages
- PHP emitting 500 on errors - where is this documented?PHP emitting 500 on errors - where is this documented?
- How to get useful error messages in PHP?How to get useful error messages in PHP?
- All PHP "White Page of Death" Questions on StackoverflowAll PHP "White Page of Death" Questions on Stackoverflow
Related errors:
- Parse error: syntax error, unexpected T_XXXParse error: syntax error, unexpected T_XXX
- Fatal error: Call to a member function ... on a non-objectFatal error: Call to a member function ... on a non-object
- Code doesn't run/what looks like parts of my PHP code are outputCode doesn't run/what looks like parts of my PHP code are output