How do I get PHP errors to display?

Asked : Nov 17

Viewed : 83 times

I have checked my PHP ini file (php.ini) and display_errors is set and also error reporting is E_ALL

I have restarted my Apache webserver.

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.

ini_set('display_errors', 1);

What is left to do?

php error-handling syntax-error error-reporting 

Nov 17

1 Answers

This Always Works For Me:

ini_set('display_errors', '1');
Ini_set('display_startup_errors', '1');

However, This Doesn't Make PHP Show Parse Errors - The Only Way To Show Those Errors Is To Modify Your Php.ini With This Line:

display_errors = On

(if You Don't Have Access To php.ini, Then Putting This Line In .htaccess Might Work Too):

php_flag Display_errors 1

answered Nov 26

Login and Submit Your Answer
Browse other questions tagged  php  error-handling  syntax-error  error-reporting or ask your own question.