Website Without PHP
English (United States)US
  • English (United States)
  • Dutch (Netherlands)
Menu

Error log

Also known as: PHP error log, error_log, debug.log

An error log is a file where your website's software writes down what went wrong, with the time and place.

Read the explanation

More about this

It is the first thing to check when a site breaks.

Hosting and infrastructure Last updated:

An error log is a file where your website’s software writes down what went wrong, with the time and place. It is the first thing to check when a site breaks. Instead of guessing which plugin is to blame, you read what was written down at the moment it failed.

What is an error log?

PHP or the web server records each error with the time, the file and the line.

When PHP meets a problem, it can show the message on screen, write it to a file or both. On a live site, the right choice is the file. The setting log_errors turns writing on, error_log names the file, and display_errors decides whether visitors see messages.

All three live in php.ini. The web server keeps its own error log as well, with problems such as a bad configuration or a timeout.

A line in the log has a time, a level, a message, a file and a line number. The level tells you how serious it is: a notice or deprecation is a warning, a fatal error stopped the script.

WordPress debug.log

WordPress can write its own log. When WP_DEBUG and WP_DEBUG_LOG are set to true in wp-config.php, messages go to debug.log inside the wp-content folder. See WP_DEBUG for the details.

It is useful, but it is a temporary tool, so turn it off when you are done.

Reading the log when your site is down

Which PHP version does your site report?

We read only what your site already sends in public: the headers and the top of the homepage. No scan, no login.

Open the log and go to the end, because the newest entries are at the bottom. Look for the first Fatal error around the moment the problem started. A path with wp-content/plugins/ followed by a folder name tells you which plugin triggered it.

A message about allowed memory size points to the memory_limit. A message about a function that does not exist often points to a PHP version mismatch.

Do not look only at the last line. A single failure can cause a chain of messages, and the first one in the chain is usually the cause.

How to find the log

Your hosting control panel usually has a logs or error section. On some hosts there is a file named error_log in the site folder. On a VPS the web server log is often under /var/log, and the PHP log depends on the configuration.

If you cannot find it, ask your host to send you the last fifty lines for your domain.

When to act

Read the log when a page shows a critical error, a white screen or a 500 error, and after every PHP update. Keep it away from public access, because logs can contain paths and sometimes personal data. If you read the message but cannot tell what to change, or the site is down and customers are waiting, our emergency help for a website down takes it from there.

Not sure how this applies to your site?

Ask a person to take a look. We check which PHP version your site runs and whether the fix is in, and tell you the next step.

Ask a person to take a look

Or have PHP updated right away: PHP update from $555 excl. VAT

Frequently asked questions

Where do I find the PHP error log?

Look in your hosting control panel, in the site folder for a file called error_log, or in the logs section of your host. In WordPress, debug.log in the wp-content folder appears when debug logging is on.

Is it safe to show errors on my live site?

No. Error messages can show file paths and other details about your setup. On a live site, keep display_errors off and log errors to a file instead.

What do I look for in an error log?

Start with the newest entries of the type Fatal error. Each line has a time, a message and the file and line. A path inside wp-content/plugins or wp-content/themes names the plugin or theme.

How big can an error log get?

A log that is never cleaned can grow very large and fill the disk. Hosts usually rotate logs. If you enable debug logging yourself, turn it off when you are done.

Share this page

Ask your AI to explain

Opens the chat with a question about this page. An AI answer can differ; the sources above are leading.

This question is sent along: Summarise the confirmed facts on https://websitewithoutphp.com/en-us/glossary/error-log/ in 5 short points, with the source per point.

  1. Domain
  2. Check
  3. Result
  4. Report

Which PHP version does your site run?

Enter your domain. We read only what your site already sends in public: the headers and the top of the homepage. No scan, no login.

We keep the domain and the result, never your IP address.