GoDaddy
iContact (AutoResponder)
PayPal
Bigcommerce
This site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies. Find out more.

How to Fix WordPress 500 Internal Server Error

 Posted by  Add comments
 

How to Fix the 500 Internal Server Error in WordPress

How to Fix WordPress 500 Internal Server Error

In this article, I will show you how to fix the HTTP 500 Internal Server Error in WordPress. If you have this error message on your site, don’t panic, it’s a common problem which we shall solve right here and now.

  • If you haven’t seen the HTTP 500 Internal Server Error, then you’re one of the lucky ones.

 

Video Tutorial

 

Note: Textual instructions follow the video if that’s what you prefer.

 

The HTTP 500 internal server error is not in fact a WordPress-specific error. It’s a general server error that is related to the server settings your WordPress site is hosted on.

Unfortunately, as this is a generic error code, it doesn’t really tell you anything useful, other than there is a problem somewhere on the server.

500 Internal Server Error

About You

To solve this problem you will need to know a little about HTTP, servers, FTP and a little knowledge on PHP coding would help. You don’t have to be an expert at any of them but a little knowledge can, and will, make life much easier.

In this article I will be using an FTP application called FireFTP (Firefox Add-on) but of course you can use an FTP application of your choice, FileZilla maybe, or even your hosting provider’s cPanel file editor if you wish. All are free.

Fix WordPress 500 Internal Server Error

Possible Error Causes

There are many server areas which could be causing the 500 internal server error problem on your WordPress site, but the most likely causes are:

  • Corrupted core WordPress files
  • Corrupted .htaccess file
  • PHP memory limit
  • WordPress plug-in functions

Before you proceed with any of these possible solutions, I suggest you read the complete article first.

Also backup your WordPress site before you make any changes. Better safe than sorry.

Some of the solutions described here are more complex than others, so pick and choose to suit your skill set.

Okay, let’s see how to troubleshoot the internal server error in WordPress.

Solution 1 to Corrupted Core WordPress Files

If you can login to your WordPress admin proceed as follows:

This solutions is nice and simple, it just replaces the WordPress core files with fresh versions. Re-installing these core files will NOT remove any of your site data, but it will solve the problem should there be a corrupt file.

Fix Internal Server Error

Re-install WordPress. Login to the admin panel of your WordPress site and from the dashboard select:

  • Dashboard > Updates > Re-install Now button

The reinstall will execute the following process:

  1. Download the update package
  2. Unpack it
  3. Verify the unpacked files
  4. Prepare the installation
  5. Enable WordPress maintenance mode
  6. Copy over the required files
  7. Disable WordPress maintenance mode
  8. Update the database

All this will all be done automatically for you, after clicking the Reinstall button.

Once the process is complete, you’ll get a confirmation message thanking you for updating WordPress.

Try browsing to your site to see if this solution solved the problem. If this solves the Internal Server Error then you know your problem was in the WordPress core folders. Investigate further if needed.

Solution 2 to Corrupted Core WordPress Files

If you cannot do the above then you need to try the following…

This solutions is just a little more complicated to implement, you need to replace WordPress core folders with fresh versions of those folders.

Re-uploading these core files will NOT remove any of your site data, but it will solve the problem should there be a corrupt file.

Method

  • Download a copy of WordPress and extract to a temporary location.
  • Enable WordPress maintenance mode if needed
  • Rename your site wp_admin and wp_include folders, i.e., wp_admin-corrupt and wp_include-corrupt
  • copy the extracted wp_admin and wp_include folders to your site to replace the old folders
  • Disable WordPress maintenance mode

With these folders replaced, try browsing to your site to see if this solution solved the problem. If it solves the 500 Internal Server Error then you know your problem was in the WordPress core folders. Investigate further if needed.

Solution to Corrupted .htaccess file

The .htaccess file is a distributed configuration file for use on web servers running the Apache Web Server software. It’s how Apache handles configuration changes on a per-directory basis.

WordPress uses this file to manipulate how Apache serves files from its directories. Most notably, WP modifies this file to handle pretty permalinks.

All WordPress sites have an .htaccess file automatically created. You can force this to happen by saving your Permalinks.

Dashboard > Settings > Permalinks

A typical .default WordPress htaccess file looks similar to the following:

 

# BEGIN WordPress
 <IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteBase /wp_test_plug-ins/
 RewriteRule ^index\.php$ - [L]
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule . /wp_test_plug-ins/index.php [L]
 </IfModule>

# END WordPress

 

To determine if your htaccess file is causing the problem go to your server and rename the file. Do NOT delete the file as there may be other settings in the file that you want.

  • If you are familiar with server side coding, take a look inside the file and see if you can spot any problems.

Now this file should be a ‘hidden’ file on your server, so you will need to tell your FTP application to show all files.

The .htaccess file will be located in your WordPress root folder, same directory where you see folders like wp-content, wp-admin, and wp-includes.

Rename: .htaccess > .htaccess-corrupt

With the file renamed, try browsing to your site to see if this solution solved the problem. If that solves the 500 Internal Server Error then you know your problem is in the htaccess file.

  • A quick way to generate a new .htaccess file is to go to Settings > Permalinks and click the save button. This will generate a new .htaccess file for you with proper rewrite rules to ensure that your posts/pages do not return a 404 error.

Now it’s up to you to edit the corrupt .htaccess file and see what caused the problem.

  • Clue, what have you been changing?

For more information on the .htaccess file, see the default .htaccess file for WordPress.

You can see the Ultimate htaccess file for WordPress here.

Solution to PHP Memory Limit

Another common cause of the 500 internal server error is exceeding the memory limit on your hosting account. You generally see the following message when you login to WordPress admin.

How to Fix WordPress 500 Internal Server Error

This is a very common WordPress error, and easily fix it by increasing the PHP memory limit in WordPress.

  • By default, WordPress automatically tries to increase PHP memory limit if it is less than 64MB. However, this is often not high enough.

For this solutions you need to edit the wp-config.php file located in your WordPress site’s root folder.

So, using an FTP application or the file manager in your web hosting control panel do the following:

  • open the wp-config.php file for editing
  • find the line that looks like; define( ‘WP_MEMORY_LIMIT’, ‘xxx’ );
  • increase this limit, i.e., define( ‘WP_MEMORY_LIMIT’, ‘128M’ );
  • save your changes to your server

The WP_MEMORY_LIMIT option allows you to specify the maximum amount of memory that can be consumed by PHP. This code tells WordPress to increase the PHP memory limit to 128MB.

You can now browse your WordPress site to see if the server errors have disappeared.

If you could not find the above define, then paste this code in the wp-config.php file just before the line that says ‘That’s all, stop editing! Happy blogging.’

·          define( ‘WP_MEMORY_LIMIT’, ‘128M’ );

If this solution does not work, then web hosting service, in all probability, does not allow you to increase PHP memory limit. You will need to contact your web hosting provider to increase your PHP memory limit for you. Many hosts set the PHP limit at 8MB.

If this solution did work, then need to contact your web hosting provider support team and have them look at the server log to discover what is using all that memory? Has your WordPress site been hacked?

Deactivate All Plug-ins

Another common cause of the 500 internal server error is a corrupt plug-in or adverse combination of plug-ins. Sadly, not all plug-ins play nicely together. Unfortunately, there is no easy way to find the culprit(s) other than to deactivate all WordPress plug-ins at once and then try to find the culprit.

Note: If your site has been running fine and installing a new plug-in has caused the error, then save yourself some time and disable that plug-in.

  • If you think deactivating your plug-ins will adversely affect your site, you can always switch to WordPress maintenance mode first.
  • Finding a rogue plug-in is a little time consuming and very tedious, especially if you have a lot of plug-ins.

The easiest way of deactivating ALL plug-ins is to FTP to your WordPress sites wp-content folder and rename the plug-ins folder.

  • i.e., \xxx\wp-content\plugins > \xxx\wp-content\plugins-corrupt

Browse your site. If disabling all plug-ins fixed the error, then you know it is one or more of the plug-ins causing the error.

  • restore the plug-ins folder name
    i.e., \xxx\wp-content\plugins-corrupt > \xxx\wp-content\plugins

Time now to deactivate each plug-in, one at a time, until you find the one that’s causing the error. Dump that plug-in, and report the issue to the plug-in author.

How to Fix the 500 Internal Server Error in WordPress Conclusion

View Server Logs

If none of the above worked then you’ll need to get a little more technical and look at the server logs. If you don’t know how to do this then try contacting your hosting provider. The server logs, should be able to pinpoint where the problem lies.

These are all the possible solutions I know that fix the internal server error problem in WordPress. Have you fixed this problem using a different method? If you know of a fix that is not listed in the article above, then please contribute in the comments below.

Also, if you have any comment, corrections or items you think should be added to, “How to Fix the 500 Internal Server Error in WordPress”, please do not hesitate to let me have them in the comment box below.

 


KingSolutions.org.uk is hosted on JustHost

 Leave a Reply

(required)

(required)

185 queries in 1.297 seconds (Child).