Documentation

Difference between revisions of "Managing PHP errors"

Line 3: Line 3:
 
= Logging errors to a file =
 
= Logging errors to a file =
  
If your username is ''foobar'', create a <code>.htaccess</code> file (for example: <code>~/wwww/.htaccess</code>) with this content, if you are a regular user:
+
If your username is ''foobar'', create a <code>.htaccess</code> file (for example: <code>~/www/.htaccess</code>) with this content, if you are a regular user:
 
  php_flag log_errors on
 
  php_flag log_errors on
 
  php_value error_log /home/user/foobar/php_error.log
 
  php_value error_log /home/user/foobar/php_error.log

Revision as of 14:59, 25 July 2016

PHP errors are not displayed by default. If an error occurs, you will simply get a blank page. This is for security reasons: this way, an attacker doesn't know about possible vulnerabilities of your website. If you want to see PHP errors, you can log them to a file, or enable the display of errors.

Logging errors to a file

If your username is foobar, create a .htaccess file (for example: ~/www/.htaccess) with this content, if you are a regular user:

php_flag log_errors on
php_value error_log /home/user/foobar/php_error.log

Or if you are an organization:

php_flag log_errors on
php_value error_log /home/org/foobar/php_error.log

Displaying errors

Create a .htaccess file (for example: ~/www/.htaccess) with this content:

php_flag display_errors on