This blog site is not meant to be any information that is distributed to the general public. It is to serve as shared documentation between the DNSTC developers; however, if you find something useful and would like to use it, go right ahead.

Monday, February 14, 2011

Turning on PHP errors on the Server

By default, if there is a PHP error, it is not displayed on the screen to the user. This is done for security reasons, but it does not aid the programmer in troubleshooting the issue. If you place some code within the .htaccess file, you can turn on the error display. The following code is used to turn on the error display for troubleshooting purposes:



php_flag display_errors on
php_value error_reporting 7


To add this code, perform the following:

  1. Use putty to log into server.
  2. cd to the appropriate /home/<users>/www directory
  3. nano .htaccess
  4. Copy and paste the code above to the file
  5. Save the .htaccess file… control/o

If you now refresh the page, you should see the error and you can be off to troublshoot!

No comments:

Post a Comment