Answer the question
In order to leave comments, you need to log in
Server error 500 instead of error alerts - what to do about it?
Good time. If errors in php code caused warnings like:
Warning: PDO::query(): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'test.wrongtable' doesn't exist in /tmp/pdo_test.php on line 18
Now any error in the code results in a server error (500).
As a result, the question arose - how to return the standard error debugger so that a server error does not occur.
There are only a couple of lines in the .htaccess file:
AddDefaultCharset UTF-8
DirectoryIndex index.php
Thank you very much for your attention!
Answer the question
In order to leave comments, you need to log in
Now any error in the code leads to a server error (500).This is normal behavior. And what you want is terrible: it will make errors undiagnosable.
try adding to .htaccess
php_flag display_errors On
php_value error_log /path/to/error.log
php_value error_reporting “E_ALL & ~E_NOTICE”
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question