Fix Error 500 Internal Server Error in WordPress

It can happen that your website suddenly has a Error 500 internal server error spends Your website can no longer be accessed and only shows this error. This is more than annoying and usually happens when you least need it.

But what is this error all about and how can you fix it? I will go into more detail on this in this post and show you some causes and solutions on how to get your website up and running again.

http 500 internal server error

This error situation occurs on the server side. This can have several causes such as a faulty update, a defective plugin or a weak server.

However, I can calm you down a bit. In about 99% of the cases, your website is not lost and your work is saved. Because the situation does not affect the databases and, as I have already mentioned, you can fix it with one of the solutions that follow in the post.

In WordPress, this error mostly occurs due to the following reasons:

  • htaccess: An incorrect or wrong code is set in the .htaccess.
  • PHP memory limit: A running process exceeds the available memory capacity.
  • PHP timeout: A script tries to access an external resource and times out due to excessive waiting times.
  • Permission Error: The permissions of the main files or main folders are set incorrectly.
  • Error in the code: An error in the code, usually caused by a plugin.

It is also quite possible that the error is caused by a problem on the host’s server. However, these errors are usually recognized quickly and the error no longer occurs after about 30 minutes at the latest.

However, if this error occurs, you should try to find out how it came about in order to avoid a 500 Internal Server Error in the future.

Error 1: bad htaccess

Should an error in the .htaccess file are present, WordPress automatically displays a 500 Internal Server Error. If this is the case, the error can be rectified very easily.

To determine if the error is caused by htaccess, all you have to do is rename the file. For this you need FTP access to your website.

You can either access your web space via an FTP program such as Filezilla, or alternatively many hosters also offer the option of accessing your FTP via the web.

  1. Log in to your FTP one.
  2. go into yours WordPress root directory.
  3. Find the .htaccess and rename them. (e.g. in “ALT.htaccess“).
  4. Then delete the cache in your browsers and reload the page.

If the page can now be loaded normally again and the error no longer occurs, the problem is with the .htaccess file.

Now you need to create a new .htaccess file. By default, it contains the following content:

# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L] # END WordPress

Now that you’ve uploaded the file back to your FTP, try accessing the website again. The error should now be fixed.

If the error keeps appearing, then the error is somewhere else and we need to keep figuring out where.

Error 2: too low memory limit

A common cause of an error 500 can also be a too low PHP memory limit. Here the server cannot provide the performance that is required. This occurs when the PHP memory limit is set too low and not enough memory is made available for the application or your website. Due to the lack of performance, the website generates a 500 Internal Server Error.

WordPress itself is already pulling quite a bit of resources. If themes and plugins are added, there is already a little that requires performance.

Here you can find the minimum technical requirements of WordPress: https://wordpress.org/about/requirements/

PHP-Version 7.4 oder höher.
MySQL-Version 5.6 oder höher
HTTPs unterstützt
The mod_rewrite Apache module

Minimum PHP requirement for WordPress themes:

post_max_size 256M
memory_limit 256M
max_execution_time 180
upload_max_filesize 256M
max_input_time 600
max_input_vars 5000

Edit the file .htaccess, which is located in the WordPress root directory. Paste the following code:

# PHP Memory Limit
php_value memory_limit 256M

Alternatively, you can also set the PHP memory limit via the wp-config.php to adjust. To do this, edit the file and add the following code:

define('WP_MEMORY_LIMIT', '256M');

You don’t have to use both variants (.htaccess and wp-config.php) execute. One of the two is enough and should then fix the problem. Of course, you can test both variations if one doesn’t work.

Error 3: broken plugins

If the previous attempts to solve the problem were unsuccessful, you must continue searching to identify the error. One of the possible causes can also be a faulty or broken WordPress plugin.

In order to be able to find the faulty plugin, you have to deactivate the plugins.

If you can still log in, you can deactivate one plugin after the other as usual in the plugin overview. After you have deactivated a plugin, call up the page again and check whether it works again. If at some point the page can be called up again after deactivating a plugin, you have found the culprit.

However, if you cannot log in, you must try to check this via your FTP access. To do this, proceed as follows:

  1. With FTP access Sign in.
  2. Go to the WordPress root directory and move to the “wp-content” walk.
  3. Folder “plugins” rename to “plugins_bak“. As a result, this folder is no longer available for WordPress and all plugins are automatically deactivated.
  4. Visit your page again.

If your page now opens again, you know that it is due to a plugin.

Now you can rename the folder from “plugins_bak” on “plugins“. Then open the folder and rename each existing folder one by one. After each change, you call up the page again. Here, too, as soon as the page can be called up again after a change, you have found the culprit.

Error 4: wrong file permissions

Usually due to a faulty or incorrect File Permission (File Permissions) no error 500 Internal Server Error occur. However, if the processes are prevented by this and a loop occurs, the server can reach its capacity limits and thus cause this error.

Basically, folders and files in WordPress have the values ​​”755” or “644“ stored as permissions. If other values ​​are stored here, this can lead to problems.

To control or change permissions, go to your FTP program or your webFTP access and look here under file permissions, access rights or file permissions. If other values ​​are stored here than those specified 755 or 644, you have to change this.

Error 5: Corrupt WordPress files

As I mentioned several times in the post, the error can also be caused by faulty WordPress updates. Files in the folders “wp-includes” or “wp-admin‘ are damaged and must be replaced in order to be complete again.

First of all, I would like to address a topic that is unfortunately often neglected. The topic is BACKUP! I can only recommend that you always create a backup before you update WordPress. Creating a backup takes only a few minutes and simply ensures that no matter what, you have a backup of your work. The plugin “BackWPup” very good.

If you have a current backup, you can simply restore the folders from this or upload them accordingly.

However, if you do not have a current backup, you must download the current WordPress installation (you can find it here: https://de.wordpress.org/download/). Then open the file and unzip the folders “wp-includes” such as “wp-admin“ and then upload it via your FTP access or FTP program.

Since these are quite a lot of files, I would recommend a FTP program instead of using the web access.

Then, when you have uploaded the files contained in the folder, clear your browser’s cache and call up the page again. You should now be able to access the page normally again.

No solution works? Ask your host

If none of the solutions mentioned in this post work and you keep getting the 500 Internal Server Error, there is only one solution left.

Contact your provider. Ask here if he can identify an error here. Often the error is not in your WordPress installation but in some server setting or similar that you cannot edit at all.

Conclusion

Over the years, I’ve also had the unintentional joy of being able to deal with the 500 Internal Server Error. Especially when you are in the process of redesigning, expanding or simply filling a website with new content, this error can just annoy you.

I have had to use all of the above solutions before. The search for the error can lead to despair if you don’t know what caused the error to occur. But if you know the error and the solutions to fix the problem, it can usually be eliminated quickly and you can continue working as usual.

timing

My name is Tim Platen and I am a trained IT specialist specializing in system integration. Here on my site you will find some instructions for different programs and how to use them.