Server got upgraded from PHP 5.2 to 5.3 and now I am no longer getting syntax errors, just a blank white page. I know this is a common question, and I normally know what needs to be done, I've just never had this situation before.
php.ini has display_errors on and error_reporting is set to E_ALL & E_NOTICE. Are there any other directives that could be affecting it? I used to get syntax error messages ("Unexpected ; in file on line..."
).
Am I being really stupid here?
The blank page of a PHP-based website is an indication that there are currently errors occurring for the site, but the errors are not output into the browser, which results in a white screen or an HTTP 500 error (Google Chrome).
Quickly Show All PHP Errors The quickest way to display all php errors and warnings is to add these lines to your PHP code file: ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL);
Missing Code The most common reason for a blank page is that the script is missing a character. If you left out a ' or } or ; somewhere, your PHP won't work. You don't get an error; you just get a blank screen.
For other types of websites, the most common reason for a blank page is code-related; for example, there may be a character missing somewhere (such as a semicolon, a quotation mark or a bracket). In those cases, instead of an error message, the website will simply show a blank screen.
I had the directive slightly wrong. The correct value in php.ini needs to be:
E_ALL & ~E_NOTICE
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With