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: ini_set("display_errors","1"); 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. | |
|
Comments (0)