8

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?

5
  • 3
    Are you reading from the correct php.ini file, and are you sure that display_errors or error_reporting is not redefined later in the file? Commented Nov 21, 2011 at 15:22
  • Maybe try putting error_reporting(-1); at the top of the file to see if that works? Commented Nov 21, 2011 at 15:23
  • 3
    wrt to the first comment, if you add a <?php phpinfo(); ?> you can determine which php.ini file your site is using Commented Nov 21, 2011 at 15:24
  • 1
    Yes, I'm reading the correct php.ini and the directives are only defined once in the file. I have tried adding error_reporting(-1) to the PHP file itself but it doesn't do anything. Commented Nov 21, 2011 at 15:29
  • It probably doesn't address your question as to why errors aren't being reported but you can run a PHP lint-check using the php executable on the file to get an actual error message: php -l myFile.php. This should catch syntax error, not run-time errors. Commented Nov 21, 2011 at 16:15

3 Answers 3

2

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

E_ALL & ~E_NOTICE

Sign up to request clarification or add additional context in comments.

Comments

1

try in php.ini

error_reporting = E_ALL | E_STRICT
display_errors = On

save and restart apache

Comments

0

you didnt mention the OS but assuming you work on an Unix variant, you can see the errors by running this command :

tail -f /var/logs/apache2/error.log 

or maybe

tail -f /var/log/httpd/error_log

And the web server configurations might have been changed too.

1 Comment

Yeah but I want them to appear on the PHP page as before.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.