How do I get PHP errors to display

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

I have checked my PHP ini file and display errors is set and also error reporting is E_ALL. I have restarted my Apache web server.

I have even put these lines at the top of my script, and it doesn t even catch simple parse errors. For example, I declare variables with a "$" and I don t close statements";". But all my scripts show a blank page on these errors, but I want to actually see the errors in my browser output.

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

What is left to do?

Answers

This always works for me:

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

However, this doesn t make PHP to show parse errors - the only way to show those errors is to modify your php.ini with this line:

display_errors = on

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/1053424/how-do-i-get-php-errors-to-display

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils