WordPress a free and open-source content management system (CMS) written in PHP and paired with a MySQL or MariaDB database. Features include a plugin architecture and a template system, referred to as Themes. WordPress was originally created as a blog-publishing system to support other types of web content including mailing lists and forums, media galleries, membership sites, learning management systems (LMS) and online stores etc.
Herewith this article, we will concentrate on the WordPress Error 500 debugging and more precisely how to utilise the error_log file placed in your WordPress files and how this log can make it easier to find critical errors in your website.
WordPress http Error 500 Debugging Using error_log File
There may be many causes you can get a 500 HTTP Error while installing WordPress. We will describe how to debug using the error_log file and listing the most common check out the reasons behind the Error 500. In most instances when you receive the following on your site looks this way. This might be extremely frustrating as for a beginner user, this error does not show anything.
With WordPress installation, the following are general reasons for the occurrence of error:
- a .htaccess file with faulty rules
- incompatible plugins, mostly after a recent update
- incompatible PHP version
.htaccess rules Debugging
Some plugins used to write rules in your .htaccess file and in most cases, those are secured, causing issues for you. To identify the cause lets try by disabling the .htaccess and access your site again. The easiest way to disable the .htaccess file is to rename it. You can take a look at the cPanel’s tool called Errors as an alternative.
Error_log file Debugging
The error_log file is standard for any PHP application including WordPress and it helps troubleshoot runtime errors showing what went wrong. These error_log files will display what went wrong so that you can easily troubleshoot.
Error_log file location:
The error_log file is usually located in the directory:
If the website is the primary for your cPanel account then it is present at:
Common issues within Error_log file:
If a plugin is responsible for your site not showing up – your error_log file will show something like:
What you should do to troubleshoot the faulty plugin is to disable it through your File Manager, for this simply navigate to the plugin directory and rename the plugin folder
Rename the faulty /wp-content/plugins/plugin-name to /wp-content/plugins/plugin-name-disabled
Turning WordPress’ error displaying on
By default WordPress might not display errors or log them due to security reasons, for example, you wouldn’t want other people visiting your site to look at sensitive information like your Database Name, User and Password which can leak. You can turn WordPress’s error displaying by doing the following:
cPanel -> Select PHP Version -> Choose your current used PHP Version -> Switch to PHP Options on the top right
Change error_reporting to E_ALL
You can also edit the wp-config.php file within your Document Root and change the following line:
This will enable visual displaying of some errors on your WordPress site.