You are currently viewing Understanding the PHP Error Log File – What, Where and How

Understanding the PHP Error Log File – What, Where and How

Imagine this scenario. You are working on your online shop, updating products and preparing a neat promotional campaign…

Suddenly everything crashes. Uh, oh!

Your website is no longer available and it’s just spewing some coded error messages you cannot comprehend. A webmaster’s worst nightmare – losing your web project and not even knowing what to do.

But fear no more!

This is where the PHP error log file comes to the stage – an invaluable assistant in the whole website management process. A virtual epitome of the famous saying that “real heroes don’t wear capes”.

What is the error log?

А website can crash due to а variety of reasons. More often than not, technological evolution is surpassing the rates at which people are updating their web pages. This opens a gap that some of your website components cannot overcome.

Let me give you an example. Your blog is smoothly running on WordPress, you have added some extra pizzazz and visitors are creating a good amount of traffic. The new release of WordPress doesn’t sit so well with your website and it suddenly it all goes offline. But what can it be?

It might come as a surprise, but a large portion of website errors are caused by old components that are not updated for a long time. This can apply to:

– old plugins
– old themes
– old application version
– wrong PHP version
– different server configuration

For the convenience of our users, we created an article about the WordPress Error Log Debugging. As WordPress is one of the most popular website building application nowadays, understanding how it uses the error_log file can make your life a lot easier.

What does the PHP error log file do?

In online projects, the error log is a file which keeps all the information about your critical website errors. Since it’s uploaded to the server, the errors are visible only to you and hidden from your visitors. If you are computer-savvy, those logs can provide crucial details that will help you locate and eliminate the issue. Even if you are a novice user, you can still get a rough idea of what’s happening and help the Support Team with the troubleshooting.

That’s another key moment here – knowledgeable support. Any good hosting provider should constantly train their Support Team to provide the best assistance possible and “reading” those error logs is a huge part of that process. A great host will even go one step further and teach you how to read the files yourself.

You are always welcome to the WebHostFace Live Chat with questions about your log files.

Where is the PHP error log file located?

There is no definite answer to that question as this strongly depends on the location of your website files on the server. In the Linux default configuration, you can find the logs in a few easy steps.

-> log in to your cPanel
-> find your File Manager
-> go to public_html (your root folder)
-> find the Log subfolder

Alternatively, you can use the php.ini file and find the line error_log.

After you locate the error logs in cPanel, you can View or Edit them for more information.

Why do you need the PHP error log file?

For starters, it is a source of priceless information that will help you learn more and diagnose website errors. It might not seem like a big deal but if you are running a campaign and your site goes down every second matter.

Every. Single. One.

Should you still need to contact your host’s Support Team, you can at least give them a good idea of what might have happened, what have you already tested and what were the results. Even if you save them just a couple of minutes of testing – this will still bring you closer to the solution.

As you learn more about the different errors, you will able to track patterns and even prevent issues from occurring again.

Let’s summarize all this.

Your PHP Log Error file detects and stores your website errors. You can find it in your cPanel and view/edit it with a simple mouse click. Learning to understand the error logs can greatly help you prevent recurring issues, fix unexpected errors, and cooperate with the Support Team of your web host.

Sounds like a pretty good deal, huh?

We will do you one better!

The WebHostFace Team is 24/7 available for you via chat, mail or phone so don’t hesitate to ask them for more info about your PHP error log.

Radoslav Chakarov

Huge music fan, from funk through hard rock and hip-hop to reggae - you name it! When not at a live show or online (rarely!) he likes chilling, surrounded by nature, with a beer in hand or riding his bicycle somewhere in the mountains.

Leave a Reply