FAQ Categories

Ask A Question

Question to be answered.
Longer question text.

WWW Resources

Hosted by WestHost

How can I turn on php error logging?

The simplest way is to create a .htaccess file either in your public root (/var/www/html) directory or in the directory where the php file you are having problems with with the following content.

Code:

php_flag log_errors on
php_value error_log /var/www/html/php-error.log

The above would create a text file in /var/www/html called php-error.log that you can view to see any errors that may have occurred. You can change both the location of the error log and the name if you like.  In fact you don't even have to give it an extension if you don't want to.

NOTE:

If you are on WH 4.0 you don't have to do anything.  By default an error log is written to the directory where the orginal php file is located. The name of the log is php(version number)_error_log by default. Version number is replaced by the major version of php that you are running on your account. By default that would be 5.

Powered by Drupal, an open source content management system