Internal Server Error Help, 500 Error
This article will discuss the commonly known causes of the 500 Internal Server Error and the general troubleshooting steps in resolving them.
Please click the links below to jump to a section.
- What does 500 Internal Server Error mean? ⤵
- Basic Troubleshooting ⤵
- What are the other possible causes of the 500 Internal Server Error? ⤵
What does 500 Internal Server Error mean?
An Internal Server Error (ISE), also known as a 500 error, is not specific only to WordPress. This error can be caused by a PHP function not working as intended, whereas a database error causes 500 errors. Both errors can, however, be resolved in the same way. Finding the cause of a 500 Error and then resolving it is often a matter of trial and error.
The 500 Internal Server Error is presented in several ways, which may include the following:
- 500 Error
- 500 Internal Server Error
- 500. That's an error
- HTTP 500 Internal Error
- HTTP 500 - Internal Server Error
- HTTP Error 500
- Internal Server Error
- Temporary Error (500)
Basic Troubleshooting
"Is your domain properly connected to your web host?"
One of the basics of troubleshooting web pages is ensuring that the domain (your website name) is active and properly connected to your web host (your hosting plan). Ensuring that requires you to check your DNS records. Let's think of it as checking the "bridge" connecting your website and your hosting server.
Please check out these articles for more information on checking your DNS records.
"Did you already try clearing/deleting your browser's cache and cookies?"
This may be a simple step, but most website error pages are caused by cache. The cache is a temporarily stored memory that helps your browser load a webpage faster. Sometimes it causes a problem when websites are updated as the web files saved in the cache may conflict with what is on the website. Clearing the cache fixes most website issues like that, including loading or formatting problems.
Check the following article on how to clear your browser's cache and cookies.
- Clear cache & cookies (Chrome)
- View and delete browser history in Microsoft Edge
- How to clear the Firefox cache
- Clear the history and cookies from Safari on your iPhone, iPad, or iPod touch
"Done with the domain check and clearing cache, but the 500 Error page is still there?"
If so, let's go ahead and try a more advanced approach. First, let us check your website's error logs.
Error logs are very useful in finding out the real cause of any website issue. Once you find out the cause, you can proceed with further troubleshooting.
To check the error logs:
- Log in to cPanel. There are two ways to access your cPanel.
- Option 1: Access your cPanel directly.
- Option 2: Access your cPanel via your Customer Portal.
- Log in to your Customer Portal.
- Click Hosting in the left-side menu.
- If you have a single hosting package in your account, scroll down to the Quick Links section.
If you have multiple hosting packages in your account, locate the hosting package you want to manage on the Hosting Packages page, then click its Manage button. - Under the Quick Links section, click the cPanel button.
- In the Metrics section, click on the Errors icon.
The logs will display the last 300 error messages in reverse order.
Once you determine the cause of the 500 Error through your error logs, we can proceed with advanced troubleshooting below.
What are the other possible causes of the 500 Internal Server Error?
Here are some of the commonly known causes.
- File permissions error ⤵
- Corrupted or broken .htaccess file ⤵
- Exceeding resources, nothing in the error logs ⤵
- Faulty third-party themes or plugins (for WordPress websites) ⤵
File permissions error
Your website has files and folders inside your web host, and each of these will have its permission settings regardless of the application used to build the site. Permissions can allow our server computer to write and edit your files. Also, some files need to be protected from writing and editing as a security measure.
To fix the 500 Error page caused by permissions error, you must ensure that your website files and folders have the correct permission settings.
- WordPress website files must be 644 or 640
- Directories and WordPress folders must be 755.
- Executable scripts within the cgi-bin folder must be 755.
- Images, media, and text files (like HTML) must be 755 or 644.
To check your file permissions:
- Log in to cPanel. (See options above on how to log into your cPanel)
- Navigate to the Files section, then click on File Manager.
- Click your website's document root. In this example, we will use the public_html folder, which is your domain's document root.
- To view all files, including the hidden ones (dotfiles), click Settings located in the top-right corner.
- Select Show Hidden Files (dotfiles) in the pop-up window, then click Save.
- All files, including the hidden files, should now be displayed. Check the Permissions column on the right. The set of numbers you will see should match the permissions listed above.
- If the file permission doesn't match the default permissions, double-click the set of numbers and enter the correct permissions.
- Once done, click Save.
For more information about file permissions, please visit these support articles:
Corrupted or broken .htaccess file
A .htaccess file is an Apache file that tells a website how to function. As one of a site's core files, it is important to ensure that the .htaccess file exists and is properly configured. The script or code for a .htaccess is written depending on the CMS or application used to build the website. If the .htaccess is missing or misconfigured, you may need to manually upload or create a new .htaccess file.
To troubleshoot a 500 Error page caused by the .htaccess, you will have to open your website's .htacces file and check the scripts within by comparing it to the article:
If there are custom scripts in the .htaccess, you may need to contact your web developer for assistance as HostGator's Support cannot assist with customized scripts and coding unique to your website.
If you find an unusual script in your .htaccess, you can comment out a line by adding # to the beginning of that particular line. For example, if the code in the .htaccess file looks like:
DirectoryIndex default.html
AddType application/x-httpd-php5 php
Then, try commenting it out like so:
DirectoryIndex default.html
#AddType application/x-httpd-php5 php
Alternatively, you can create a new default .htaccess file instead.
Here are helpful articles to guide you in editing and creating a new .htaccess file.
- How to Edit Your .htaccess File
- How to Create/Edit/Delete a File Using the File Manager
- Default files .htaccess and php.ini
If you cannot determine which line is the problem, comment on every line.
After commenting out a line(s), refresh the site to see if the issue has been resolved. If it has, that confirms that the issue was in that particular line of code in the .htaccess file. If the issue has not been resolved, continue troubleshooting by commenting out additional lines and reloading the website.
Exceeding resources, nothing in the error logs
Too many processes may be causing the 500 error in the server queue.
With SSH (shell) access, you can view the processes running on your account. Type this command:
ps faux
Or type the following command to view a specific user's account. (Be sure to replace the username with the actual username.):
ps faux |grep username
Type the following command to kill the specific process once the process ID (pid). (Be sure to replace pid with the actual process ID.):
kill -9 pid
Faulty third-party themes or plugins (for WordPress websites)
Faulty themes or plugins may also cause a 500 Internal Server Error page for WordPress websites. Before looking into faulty themes, you may need to determine which plugin is causing the 500 error. A 500 error page (possibly) generated by a plugin can be fixed by disabling and enabling the plugins individually. Once the faulty plugin is identified, you may need to deactivate it. Ensure to inform to create a backup of the website first before making any changes to the website.
One of the recommended ways of activating/deactivating plugins is through the WordPress dashboard. As a reference, here is a support article you can use, How to Install/Uninstall WordPress Plugins.
If you confirmed that none of the WordPress plugins is causing the issue, it might be the WordPress theme itself. Please change the WordPress theme through your dashboard.