Programming FAQs

How to enable PHP error reporting via .htaccess File

Sometimes it's useful to unhide errors PHP script generated for debugging. But on many servers, php.ini's configuration has disabled error displaying for security purposes. This quick tutorial explains how to display PHP errors by modifying the .htaccess file.

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

Listed in
Syndicate content