Knowledgebase: Hosting FAQ > CGI and PHP
Debugging PHP scripts
Posted by - NA -, Last modified by Jen Ferraz on 30 March 2011 02:02 PM
On most servers, PHP scripts are set to not log NOTICE errors, or possibly more, to your site's error_log file.

 If you are trying to debug your code, the following statements should be added to the top of your PHP files so they'll display the errors to the browser:

error_reporting (E_ALL);

Alternatively, you can set error reporting for an entire directory of PHP files, or the entire site, by using a .htaccess file containing the following:

php_flag display_errors on
php_value error_reporting 2047

The .htaccess file can be placed in the directory you need the error reporting.

(438 vote(s))
This article was helpful
This article was not helpful

Comments (0)
Post a new comment
Full Name:
CAPTCHA Verification 
Please enter the text you see in the image into the textbox below. This is required to prevent automated registrations and form submissions.

Help Desk Software by Kayako