Creating a PHP Error Log

Written By: Tim Sisson
Experience Level: Beginner
Articles labeled as Beginner are those that require basic tasks to be completed, such as making simple configuration changes following a brief set of instructions. If you find yourself needing assistance, our Technical Support Department can generally assist.
Print E-mail:

PHP, has a solution to log all of your errors to a specific log file. It's simple, as you just have to add a line of code to your php.ini file. For this example we'll create a log file in the root directory: /home/username/phperror.log (dont forget to replace the username in the file path with your actual cPanel username):

error_log = /home/username/phperror.log

If you would like more information on working with your php.ini file, please review the following article:

Updating your local PHP settings

You will also need to write a basic PHP script to generate and update the log file. For more information on sending PHP errors to a log file please review the following link:

http://www.php.net/manual/en/function.error-log.php

If you are looking for the general error log for your cPanel account. you can find it within cPanel itself. On the cPanel home screen, click on the "Error Log" icon.

cpanel-error-log

 
Rating:
 
Please log in to rate this article.
Like this Article?
Notify Me of Updates!
Please login to subscribe to receive notifications when this article is updated.
Prerequisite Articles
None

Comments

Currently no comments

You must log in before commenting.

Need more Help?

Search
Current Customers
Chat:Click to Chat Now
Call:888-321-HOST (4678)
E-mail:support@InMotionHosting.com
Ticket Submit a Support Ticket
Ask the Community!
Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.
Not a Customer?
Get web hosting from a company that is here to help. Sign up today!

Follow InMotion Hosting!

 4244 Followers. Follow Us!

Have a Question?

If you need some help, submit your question to our Community!
We guarantee a response within 60 minutes (8am - 5pm EST, Monday - Friday)

Recent Questions