How to Enable Error Logging on Shared Hosting

When something goes wrong on your website - a blank page, a 500 error, or broken functionality - error logs are often the fastest way to find out what happened. dotCanada shared hosting supports PHP error logging, which you can enable through your .htaccess file or a php.ini file.

Enable PHP Error Logging via .htaccess

Add the following to your .htaccess file in public_html:

php_flag log_errors on php_value error_log /home/yourusername/php_errors.log

Replace yourusername with your actual cPanel username. Errors will be written to that file instead of being displayed on screen - which is the correct behaviour for a live site.

Enable Logging via php.ini

Alternatively, create a php.ini file in the directory where you want logging active, with these lines:

log_errors = On error_log = /home/yourusername/php_errors.log display_errors = Off

Viewing Error Logs in cPanel

cPanel also provides access to your server-level error log. Go to Metrics > Errors to view the most recent entries for your account - this is a quick way to spot PHP fatal errors or missing file warnings.

Turning Off Display Errors on Live Sites

Make sure display_errors is set to Off on your live site. Displaying errors publicly can reveal sensitive path or configuration information to visitors.

If you're struggling to interpret your error logs or track down an issue, contact our support team - we're here to help.

100% Satisfaction Guarantee

We're so confident you'll love dotCanada that we offer a 30-day money-back guarantee. Not satisfied? Get a full refund, no questions asked.

Ready to Get Started?

Join thousands of Canadian website owners who trust dotCanada for reliable, fast web hosting.

Get Started Today