Home Guides Glossary

Setting up Custom-Defined PHP Error Logs in cPanel

cPanel offers built-in error logging, but it doesn't catch errors generated from PHP and doesn't keep error logs for extended periods of time. To remedy this, you can have PHP store errors it encounters in your own error log file.

To Set up Custom-Defined Error Logs in cPanel

  1. Create a file called php_error.log — you can either do this locally and FTP it to your server (more info), or you can use cPanel's built-in file manager (more info).
  2. Create or edit a PHP initialization file (you can find the name you should use here) containing the following line of code:
    error_log = /home/[your username]/public_html/php_error.log
    You can find the value for [your username] in Find your FTP login/username

Now, PHP will pass any coding-related errors to the php_error.log file. This file can take a few hours before it starts receiving errors your website generates, and only displays content if your website does generate errors.

Domain Registration

Pay less for website domain names. Register your own .com, .net or .org for as low as $10.18 per year. We have everything you need to get online with your new domain.

Website Builder

Build an amazing website in just under an hour with Website Builder. Take advantage of designs created just for your industry and then customize them to reflect your one-of-a-kind idea.

Website Security

Protect your website and keep customers safe. Your comprehensive Website Security solution. Get peace of mind by securing your websites.

cPanel Hosting

Everything needed to give your website the high-performance home it deserves.  Protect transactions and secure your customer's data with a SSL Certificate
Copyright © 2005 - 2024.  All rights reserved.  Privacy Policy