fix-500-internal-server-error-on-wordpress

How to Fix a 500 Internal Server Error on WordPress

It’s very weird that the 500 internal server error shows up on an unexpected time and you’re left confused how to get back to your WordPress website just like before. Although it’s common issue but it affects your website’s credibility and viewership. No one wants that for their business.

If you think it takes a very detailed and technical knowledge to fix the 500 internal server error on your WP site, you need to take a look at this post.

What is an Internal Server Issue?

Your web browser requests the website’s (you’re trying to access) hosting server to open the website. In response, the server provides the resources that the browser requested along with an HTTP header (including the status code). If the status code comes back with the 500 error it means that there’s an unexpected situation that stops the server to fulfill your request.

What to Do to Fix the 500 Internal Server Error?

The 500 error springs mainly on two ends due to different reasons, the first being on the client side and the second being on the server. Let’s resolve the both.

  1. Reload the Page

It’s a no brainer but we’ll mention it anyway. Whenever you encounter any issue with a website, be it the 500 internal server error, wait for a minute and refresh the page by using Ctrl + F5 keys or simply pressing the F5 key. You can also try opening the website in some other web browser.

  1. Check server logs

You can check error logs through WP debugging mode. Here, you can activate logging by entering this code to your wp-config.php file:

( ‘WP_DEBUG’, true );

( ‘WP_DEBUG_LOG’, true );

define( ‘WP_DEBUG_DISPLAY’, false );

  1. Inspect your Theme and Plugins

A corrupt, outdated, or unreliable plugin can also be the reason why you might be facing the 500 internal server error. To fix it, you can deactivate each plugin installed from an untrusted resource and change the theme for the time being and check whether the issue has been resolved. Once done, reactivate each plugin and theme one by one to check which plugin was at fault.

  1. Unable to Establish Database Connection

Database connection error is also one of the causes. This can happen due to many reasons such as a corrupted WP database, corrupted WP installation files, incorrect database login credentials, error on the web host end, etc. You need to check and fix these individually to resolve the 500 internal server error.

  1. Clean up Cache

Your browser cache must be outdated or perhaps there are too many cache files for the same website. It is recommended to clean up your browser cache to fix the 500 internal server error.

  1. Permission Error

It could be a WordPress files and folders permission error that’s causing the 500 internal server error. You can fix this issue by making sure these:

  • There should be no 777 given to any of the directories
  • Each file should be 640 or 644
  • Each directory should be 750 or 755
  • Set the wp-config.php to 400 or 440 so that only you can read the file

Fix these to resolve the internal server error.

  1. Reinstall your WordPress Core Files

Sometimes older websites face issues with their WordPress core. You can re-upload these files without affecting your theme and plugins. Just make your data’s backup first. Then, head to the Dashboard > Updates > Re-install Now. Once the process is complete, you will get fresh WordPress core files.

  1. PHP Memory Limit

An exhausted PHP memory limit can also be a reason. You can increase the limit on your own. We’ve described how to do it in the php.ini file.

  • Use FTP or SSH to log into your website
  • Head to the root directory
  • Open the php.ini file and look for the three settings to edit them
  • If you don’t have the file already, create one and paste this code

memory_limit = 128M

[Note: The values can be changed as per your preferences.]

If you have a shared host that requires you to create a suPHP directive in the .htaccess file first in the (same) root folder to make things work, do this by adding this code:

<IfModule mod_suphp.c>

suPHP_ConfigPath /home/yourusername/public_html

</IfModule>

  1. A PHP Timeout

If the external resources to which your script connects time out, you can face a 500 internal server error. To fix this, modify your handling in your script.

  1. Check your .htaccess File

It’s not a common reason though, but you can still make sure the structure of the .htaccess file is proper. Do this by adding this code to the server:

# BEGIN WordPress

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteBase /

RewriteRule ^index\.php$ – [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /index.php [L]

</IfModule>

# END WordPress

You need to log into your website via FTP or SSH first and change the name of your .htaccess file to .htaccess_old. Now, create a new .htaccess file to paste the above code in it.

  1. Error on the Server End

Check with your host to make sure the 500 internal server error is not the result from an error on the server end. If yes, ask for an instant resolution.

Read more:- Fix WordPress 404 Error

Your Comment:

Related Posts

change menu color in wordpress

09

Jun
How To

How to Change the Menu Color in WordPress?

You have spent so much time searching for the most appropriate website theme as per your business. You have finally found the right one: the best layout, font, and everything else. But you are facing an issue which is how to change the menu color. Changing header color in WordPress is also easy. Do not worry, WordPress […]

Change WordPress Theme

05

Jun
How To

How to Change WordPress Theme without Losing Content?

Do you want to change WordPress theme without losing content? If yes, this guide will help you. WordPress is a CRM that can be quickly modified. Your website may have been outgrown to an existing theme and would obviously look amazing with the added features. Altogether, a WordPress theme will accomplish everything.   All in all, you[…]

Change WordPress Background Color

01

Jun
How To

How to Change WordPress Background Color of a Single Page?

The first thing any website visitor notices is the background color and font of a website. Agree? The background color gives a powerful impression of your business. Well, it’s one of the essentials of quality design. The color and the website visuals reflect your brand, style, readability, and even professionalism. This is the reason why deciding the[…]