When your website shows a blank page, a 500 error or a vague "something went wrong" message, the browser is only telling you half the story. The other half is written down in your server error logs. They record what the web server and your code were doing at the moment things failed.
Logs can look intimidating at first: long lines of timestamps, file paths and jargon. But once you know where to find them and how to break down a single line, they become one of the most useful troubleshooting tools you have.
The main types of logs
Different logs record different things:
- Web server error log: Problems the web server (Apache, LiteSpeed or Nginx) ran into, such as missing files, permission problems, blocked requests and crashed scripts.
- PHP error log: Errors, warnings and notices produced by PHP code, including WordPress, plugins and themes.
- Access log: Every request made to your site: who asked for what, when, and what status code was returned. It's not an error log, but it's essential context.
- Application logs: Logs written by the software itself, such as WordPress's
debug.logor a store platform's own logs.
Where to find your logs
In cPanel
- Metrics > Errors shows recent web server error entries for your account.
- Metrics > Raw Access lets you download access logs.
- PHP errors are often written to a file named
error_login the folder where the script ran, such aspublic_htmlorpublic_html/wp-admin. Use File Manager (with hidden files shown) to find them.
In DirectAdmin
- From your domain's Site Summary / Statistics / Logs area, you can view the error log and access log for each domain.
- PHP
error_logfiles may also appear in your site folders.
On a VPS or dedicated server
Common locations include:
- Apache (Debian/Ubuntu):
/var/log/apache2/error.log - Apache (RHEL-based systems):
/var/log/httpd/error_log - Nginx:
/var/log/nginx/error.log - PHP-FPM: often under
/var/log/with a name that includesphpand the version - System and service logs:
journalctl -u servicename
Locations vary by distribution and configuration, so check your web server's config if a file isn't where you expect.
In WordPress
WordPress can write its own debug log. In wp-config.php, set:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
Errors will then go to wp-content/debug.log without being shown to visitors. Turn debugging off again when you're done, and delete the log, because it can contain sensitive paths.
How to read a log line
Here's a typical PHP error as it might appear in a log:
[14-Mar-2026 09:42:17 UTC] PHP Fatal error: Uncaught Error: Call to undefined function get_field() in /home/user/public_html/wp-content/themes/mytheme/single.php:27
Break it into pieces:
- Timestamp:
14-Mar-2026 09:42:17 UTC. When it happened. Note the time zone, which may not match yours. - Severity:
PHP Fatal error. How serious it is. - Message:
Call to undefined function get_field(). What went wrong. - Location:
/wp-content/themes/mytheme/single.phpon line27. Where it went wrong.
In plain English: the theme's single.php file tried to use a function called get_field() that doesn't exist, probably because the plugin that provides it was deactivated. The fix is to reactivate that plugin or update the theme code to check first.
A web server error line usually follows a similar pattern, often including the visitor's IP address ([client 203.0.113.5]) and the module that logged the error.
Understanding severity levels
PHP messages come in levels. From most to least serious:
- Fatal error: The script stopped. This usually causes a blank page or 500 error. Fix these first.
- Parse error: A syntax mistake in the code, like a missing semicolon or bracket. Often appears right after someone edited a file.
- Warning: Something went wrong, but the script kept running. Worth fixing, as warnings can lead to bugs.
- Notice / Deprecated: Minor issues or code using features that will be removed in future PHP versions. Usually not urgent, but they matter when you upgrade PHP.
Common messages and what they mean
- "Allowed memory size of X bytes exhausted": The script ran out of memory. See fixing the WordPress memory limit error.
- "Maximum execution time exceeded": A script ran longer than allowed, often an import, a backup or a slow external request.
- "Permission denied": The server can't read or write a file. Check file permissions and ownership.
- "File does not exist" / "No such file or directory": Something requested a missing file. Often harmless (bots probing), but repeated entries for your own files point to broken links or a bad path.
- "client denied by server configuration": An access rule blocked the request, often from
.htaccess. - "Premature end of script headers" / "End of script output before headers": A script crashed before it could send a response. Check the PHP error log for the real cause.
- ModSecurity messages: A security rule blocked the request. If it's blocking legitimate actions, your host can help review the rule.
- "Error establishing a database connection" or database access denied messages: See our guide to fixing database connection errors.
A simple process for using logs
- Reproduce the problem. Load the broken page or repeat the action that fails.
- Note the exact time. This lets you find the matching log entry.
- Open the newest entries. Errors are usually added at the bottom of log files.
- Find the first error. One problem can trigger a chain of later errors. The earliest one at that time is usually the real cause.
- Read the file path. It often tells you which plugin or theme is involved, because the folder name is in the path.
- Search the exact message. Copy the message (without your personal paths) into a search engine or the plugin's support forum.
- Fix, then check again. After the fix, reload the page and make sure no new errors appear.
Handy commands on a server
If you have SSH access:
tail -n 50 error.logshows the last 50 linestail -f error.logshows new lines as they arrive, which is great while reproducing a buggrep "Fatal" error_logfinds only fatal errorsgrep "14-Mar-2026 09:4" error_lognarrows results to a time window
Keep logs useful and safe
- Don't show errors to visitors on a live site; log them instead.
- Delete or rotate large log files that eat into disk space.
- Don't share full logs publicly. They can contain file paths, IP addresses and other sensitive details.
Wrapping up
Server error logs turn a mysterious broken page into a specific message, file and line number. Learn where your logs live, read each entry as timestamp, severity, message and location, and focus on the first fatal error at the time of the problem. With a little practice, you'll find and fix issues far faster than by guessing.