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

Last updated:

How to Show PHP Errors and Read the Error Log

Your site hides technical error messages from visitors, which is right for a live site, but it also means a broken page can look blank without telling you why.

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.

Get help with your website

More about this

To find the reason, you read the error log instead of showing errors on screen, because on-screen messages can show visitors details about your server.

The steps below show how to do that safely.

Error

To show PHP errors, you switch on the display_errors setting, but the safer way to see them is the PHP error log, which records the same messages in a file that visitors never see. Most servers hide errors on screen by default, which is why a broken page often looks blank.

What the settings do

PHP has a few settings that control error handling. The display_errors setting decides whether messages are printed into the page. The log_errors setting decides whether they are written to a log file.

The error_reporting setting decides which types of messages are included, from notices up to fatal errors. A production site should log errors and not display them. A development or staging copy can display them to make debugging faster.

Why displaying errors on a live site is risky

On-screen messages often include file paths, function names and sometimes details about the setup. Every visitor can read them, and they can also break the page layout. That is why you should not leave display switched on for a public site.

If you must look at the output on a live site, do it briefly and switch it off again right after.

Where to find the error log

Many hosting panels have an error log section. The log is often a file named error_log or php_errors.log, placed in the site folder or in a logs folder outside it. Your host can tell you the exact location.

On WordPress you can set WP_DEBUG and WP_DEBUG_LOG to true and WP_DEBUG_DISPLAY to false. By default the log is wp-content/debug.log, which is usually reachable from the web, so point WP_DEBUG_LOG to a path outside the web root or delete the file when you are done.

How to read a log entry

Each entry normally holds a time, the error type, the message, the file path and the line number. Start at the newest lines. Look for the type first: notice, warning, deprecated, parse error or fatal error.

Then open the file and line mentioned. Repeated entries with the same line are the ones worth fixing first.

What you can try yourself

First, take a backup. Second, locate the log in your hosting panel and read the latest entries. Third, if there is no log, enable logging to a file, reproduce the problem once, and read the new entry.

Fourth, if you need to see messages on screen, do it on a staging or local copy. Fifth, switch debugging off again when you are finished and delete old debug logs. Keep passwords and keys out of anything you share.

When the PHP version is the cause

If entries mention deprecated features or removed functions after an update, the PHP version is probably involved. The supported versions page on this site explains which versions the PHP project still maintains.

When to get help

If you cannot reach the log, or the entries point at code you cannot change, ask for help. At Website Without PHP a human replies within 1 business day. A rush repair starts from $425, excluding VAT.

Frequently asked questions

Is it safe to turn on display_errors?

On a staging or local copy, yes. On a live site only very briefly, because every visitor can read the messages. Logging to a file gives you the same information without that risk.

Where is the PHP error log on shared hosting?

Usually in the hosting control panel under a heading such as errors or logs, or as a file named error_log in the site folder. If you cannot find it, ask your host for the location. They can also tell you whether logging is switched on.

Why is my error log empty?

Logging may be switched off, the log may be written to another location, or the problem is not a PHP error at all, for example a web server or caching issue. Reproduce the problem once after enabling logging and look again.

Should I delete old log files?

Yes, once you have read them. Old logs take disk space and can contain paths and other details you do not want lying around. On WordPress this applies especially to wp-content/debug.log, which is usually reachable from the web.

Sources

Accessed on November 17, 2026.

  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.