How to enable PHP errors via .htaccess File

Sometimes it's useful not to hide errors PHP script generated in order to debug. How to enable those error messages ?

1 vote
+
-

You can enable error reporting under Apache, even if you don't have administrator rights and can't access main httpd.conf file.
To enable error reporting in PHP, use your favorite text editor and add the following line to the .htaccess file located in the directory where your .php files reside:

php_flag display_errors on

This will override Apache's default settings to display PHP errors, unless your Apache configuration doesn't allow this modification.

-1 votes
+
-

You can also enable displaying of error messages in php.ini file.

Know the answer? Share it!

Your answer will appear immediately.