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.
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.
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.