Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP - Syntax errors no longer showing (blank white page)

Tags:

php

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?

like image 661
BadHorsie Avatar asked Nov 21 '11 15:11

BadHorsie


People also ask

Why is my PHP page blank?

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).

How do I get PHP errors to display?

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);

Why did my PHP page load all white?

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.

Why do web pages show blank pages?

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.


1 Answers

I had the directive slightly wrong. The correct value in php.ini needs to be:

E_ALL & ~E_NOTICE

like image 109
BadHorsie Avatar answered Oct 26 '22 22:10

BadHorsie