How to Find and Read WordPress Error Logs on cPanel
In this article10 sections
A WordPress error log gives you a useful starting point when a page goes blank, the dashboard stops loading, or a feature breaks after an update. On cPanel hosting, you may have two different places to look: WordPress’s own debug.log and the server error list under Metrics → Errors. They record different things, so checking the right one can save a lot of guesswork. If you are new to the control panel, see our cPanel overview first.
This guide walks through both logs, shows how to turn on WordPress logging without displaying errors to visitors, and explains what to do with the entries you find. If the problem is that the site has become slow rather than visibly broken, start with these checks for a slow WordPress site on cPanel.
Which log should you check?
Start with the cPanel error list if WordPress will not load at all or you cannot reach the dashboard. It can show web server errors that happen before WordPress has started. If the site loads but a plugin, theme, form or scheduled task behaves incorrectly, WordPress’s debug log is often more helpful because it records PHP messages generated while WordPress runs.
- cPanel Errors: a quick view of recent web server errors for your account. The interface may not be enabled on every hosting plan.
wp-content/debug.log: WordPress and PHP messages captured after debugging is enabled. You usually need File Manager, SFTP or SSH to read it.- PHP or web server logs: additional logs your hosting provider may expose. Their names and locations depend on the server setup.
Neither log is a full record of every visit to your site. Access logs record requests; error logs record problems. For a broken page, the error log is usually the better place to begin.
Check recent errors in cPanel
- Sign in to cPanel for the domain that is having trouble.
- Open Metrics → Errors. If you do not see it, your host may have disabled the interface or use a different control panel.
- Look for entries whose time matches when you saw the problem. cPanel shows recent web server errors, often up to 300 entries.
- Note the message, timestamp, URL if listed, and any file path or line number.
The list may contain messages from other requests or automated traffic. A single old warning is not necessarily the cause of today’s problem. Refresh the page that fails, then check for a new entry at the matching time. If nothing relevant appears, use the WordPress debug log next or ask your host which PHP log applies to your account.
Tip. Copy the complete message and timestamp before changing anything. A precise error is easier to search or share with your developer than a screenshot of a long log page.
Enable the WordPress debug log
WordPress can write PHP warnings, notices and errors to a file called debug.log. You need access to your site files to change wp-config.php. Before editing it, make a copy of the file or take a backup. A misplaced character in this file can prevent the site from loading.
- In cPanel, open File Manager and navigate to your WordPress installation. This is often
public_html, but an addon domain may use a subfolder. - Find
wp-config.php. If it is hidden, enable the option to show hidden files in File Manager settings. - Edit the file and find the comment
/* That's all, stop editing! Happy publishing. */or similar. - Place these lines above that comment. If
WP_DEBUGis already defined, update the existing setting instead of adding a duplicate.
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
Save the file, then repeat the action that caused the problem. WordPress writes new messages to wp-content/debug.log. It may not create the file until something is logged. Open it through File Manager or SFTP and look at the newest entries at the bottom.
Keep WP_DEBUG_DISPLAY set to false on a public site. That keeps PHP messages out of the page visitors see, where file paths and technical details could otherwise be exposed. For regular development, use a staging copy rather than leaving debugging enabled on a busy live site.
Keep the log private
The default log is inside wp-content, which is part of the website’s files. Depending on the server configuration, a web address might expose it. Try not to leave a readable error log in a public location.
If you have a safe location outside the website’s public folder and permission to write there, you can use its full server path instead of true for WP_DEBUG_LOG, for example:
define( 'WP_DEBUG_LOG', '/home/account/private-logs/wp-errors.log' );
The directory must already exist and be writable by the PHP process. Ask your hosting provider for the correct private path if you are unsure; a wrong path can mean no log is written. On some hosts, the provider may offer a protected log viewer instead.
Do not share a raw log publicly. It can contain server paths, plugin names, database details, email addresses or other information from the request. Remove or mask anything sensitive before sending a relevant excerpt to support.
Read an error message without guessing
A PHP log entry usually includes a date, severity, message and file location. For example, a message mentioning a fatal error in wp-content/plugins/example/ points to code in that plugin. A line number tells you where PHP noticed the problem, but the underlying cause can be earlier in the request.
- Fatal error: execution stopped. The file and line in the message are the first places to inspect.
- Warning: something went wrong, but PHP may have continued. Repeated warnings can still break a feature or reveal an outdated component.
- Deprecated: code is using an older interface. It is often a sign to update the plugin or theme, but does not always explain a visible failure on its own.
- Database error: a query failed. Note whether the message names a plugin or custom table, then check for a related update or configuration change.
Look for the first new entry after reproducing the issue. Several later messages may be side effects of the original failure. If an error names a plugin or theme, note its version and whether it was recently updated before making changes.
Common messages and sensible next steps
- “Allowed memory size exhausted”: PHP reached the memory limit during a request. The trigger may be an import, a heavy plugin or a particular page. Check whether the error repeats on one action, then ask your host what memory limit applies before changing PHP settings.
- “Maximum execution time exceeded”: a request ran longer than PHP allows. Large imports, backups and slow external services can trigger it. Retry during a quiet period and inspect the relevant plugin or task.
- “Call to undefined function” or “Class not found”: a function or class was unavailable when the code ran. This can happen after a plugin is disabled, an incomplete update, or a compatibility problem between components.
- “Failed opening required”: PHP could not find a file the code expected. Check the named path and whether an update or manual cleanup removed the file.
- “Error establishing a database connection”: check the database service and the credentials in
wp-config.php. On shared hosting, your provider can confirm whether the database server had an outage.
Do not edit plugin or theme files just to hide a message. If the code belongs to a commercial plugin, send its developer the exact error, component version and steps to reproduce it.
If the debug log is missing or empty
An empty log does not always mean there is no error. Check these points before changing permissions or server settings:
- Confirm the three constants are in
wp-config.php, above the stop-editing comment, and are not defined a second time elsewhere. - Visit the page or run the action again after enabling logging. The file is created when WordPress has something to write.
- Make sure you are looking in the active WordPress installation’s
wp-contentdirectory. Sites with staging copies or multiple domains can have several installations. - Check whether the directory is writable. Avoid setting broad permissions such as 777; ask your host to check the correct ownership and permissions.
- Look at cPanel’s Errors page or contact hosting support. A parse error in
wp-config.phpor a database connection failure can happen before WordPress can write its own log.
Turn debugging off when you are done
Once you have collected the error and fixed or handed off the problem, switch the constants back off:
define( 'WP_DEBUG', false );
define( 'WP_DEBUG_LOG', false );
define( 'WP_DEBUG_DISPLAY', false );
If you changed existing definitions, edit those lines rather than adding another set. Save the file, load the affected page once more, and confirm that errors are not displayed to visitors. Then remove the old log if you no longer need it; it can contain sensitive details and may grow over time. If the problem is fixed by updating a plugin or theme, make a fresh backup and keep a note of the error and change that resolved it.
A quick checklist
- Use cPanel → Metrics → Errors for recent web server messages.
- Use
debug.logfor errors generated while WordPress is running. - Keep display errors turned off on a live site and protect any log file from public access.
- Match the log timestamp to the moment you reproduced the problem.
- Save the full message before updating, disabling or editing anything.
- Turn debugging off and remove the log after troubleshooting.
Frequently asked questions
Where is the WordPress debug log?
By default, it is wp-content/debug.log inside the active WordPress installation. It appears after logging is enabled and WordPress records a message. You can set a different path with WP_DEBUG_LOG, provided the path is valid and writable.
Can I find WordPress errors in cPanel?
Yes. Open Metrics → Errors if your host has enabled it. This interface shows recent web server errors. For PHP messages generated inside WordPress, enable the WordPress debug log as well. If neither view includes the relevant entry, ask the host which PHP error log is available for your account.
Is it safe to enable WP_DEBUG on a live site?
Use it briefly and keep WP_DEBUG_DISPLAY set to false. A staging site is a better place for ongoing debugging. When you have the information you need, turn logging off and remove the log if it is no longer needed.
Why can’t I see the Errors option in cPanel?
The hosting provider controls which cPanel features appear on an account. Check with support for another way to view the domain’s PHP and web server logs.