Page 1 of 1

How do I log errors for my PHP scripts?

Posted: Sat Jan 11, 2014 10:22 am
by Spray
You can override our default php.ini settings and log all of your site's PHP errors locally using a directory-level configuration file, known as .htaccess.

To do this, create a new file with the following contents:

Code: Select all

php_flag log_errors on
php_value error_log /usr/www/YOUR_IDENTIFIER/php_errors.log
Be sure to replace "YOUR_IDENTIFIER" with the identifier you've chosen for your webhosting.

Save this file as ".htaccess" and place it inside of the root directory for your site. By default, this will be the "public" directory. After saving this file, you should see errors written to a php_errors.log file inside of the directory specified by the file.