Contact Us
Support

Call Us Today!
(540) 324-6490


Blizzard Media

Shared Hosting with 99.9% uptime. Domain Name Management. Welcome to Blizzard Media.


Search: Browse by Category:
How do I show PHP errors?
 
Print
Tell a Friend
Author: Ricky Nelson
Views: 1
Votes: 0

 

Blizzard Media runs production servers so the default PHP configuration specifically prevents PHP errors from displaying. If an error is given, it will either be suppressed or the entire file may just display as a blank page. This prevents would be attackers from using that information to attack your site. However Blizzard Media understand that deployment does not always work out as planned and it would be nice to be able to see some error information in order to be able to debug your deployment. Below is a method that will allow you to see PHP errors on your site:

  • Create a file called .htaccess in the directory containing the PHP file(s) that you wish to debug.
  • Add the following to the .htaccess file:
    php_flag display_errors on
    php_value error_reporting 7

If you already have an .htaccess file in the directory that you want to add debugging, then just append the statements in the second step to the already existing file. Blizzard Media highly recommends that you comment out these lines when you have completed your debugging. To comment the line just add a # at the beginning of the line.

Last update: 11:01 PM Sunday, February 17, 2008

Related Questions: