PHP error log on shared hosting

If you use PHP in your website, many times you may get a blank page or something does not work properly. In these cases, it helps to look at the errors generated by PHP. On ServerGrove servers, display_errors is turned off for security purposes (so errors are not sent to the browser embedded in pages).

If you are using Symfony, you can view your PHP error log using Maestro (view the screencast). Otherwise, in order to view the PHP errors you have two options:

  1. look at the error_log of apache. This file is located in statistics/log/error_log and contains all errors from Apache, including those from PHP. This is not accessible through the web, only through FTP, Control Panel File Manager or SSH if available.

  2. turn on display_errors (this is recommended only for testing and troubleshooting). To turn display_errors on, create a file called .htaccess (using the File Manager in the Control Panel) and put the following line inside:

php_flag display_errors 1

Next, all PHP errors will be included in your HTML. Remember to turn off this feature when you are done.