Fix 500 – Internal Server Error

Most visitors to a website will probably have seen this error at some point. The error codes from 500 – 510 say nothing other than that there is a problem with the server. Most of the time, the very unspecific code 500 – Internal Server Error appears, without any further information as to what caused the error. The visitor cannot change anything about the error at the moment and only try to access the page again at a later time. For every administrator of a site, however, this means that you have to go on a lengthy search for the error.

In WordPress, the error usually occurs when using plugins or themes. It often happens that when updating to a newer version, not everything runs smoothly and the server then throws an internal error. The error can also be in the .htaccess or in the PHP memory limit. But for each of these problems there is a solution.

is needed

  • FTP access data
  • MySQL credentials

subjects

  • Checking the plugins
  • Checking the .htaccess
  • Increase PHP memory limit
  • Replace WordPress core files

Checking the plugins

In most cases, the problem lies in one of the plugins. To find out, all plugins must first be deactivated. You can do this either via FTP or via phpMyAdmin

Disable plugins via FTP

The plugin folder, usually under /wp-content/plugins, is renamed from /plugins to eg /plugins_deactive. By renaming the directory, WordPress no longer finds the plugin folder, which also deactivates all plugins in the system. If the login to the backend should now work again, the folder can be renamed to /plugins and one plugin after the other can be reactivated via the backend. If the Internal Server Error occurs again when activating one of the plugins, it is clear which plugin is causing the error. Then you have no choice but to leave the plugin in question deactivated until a bug fix is ​​delivered by the developer.

Disable plugins via phpMyAdmin

In order to activate the plugins via phpMyAdmin, the login data of the MySQL database are required. A backup should be made before making changes to the database. After backing up the database, you can access the input field for database commands via the SQL tab in phpMyAdmin. At this point, the following line of code is copied.

UPDATE wp_options SET option_value="a:0:{}" WHERE option_name="active_plugins";

Fix 500 errors media agency in berlin

The command deactivates all plugins in WordPress, which can now be activated individually via the backend to determine whether the internal server error occurs due to one of the plugins. If the error can be corrected in this way, the problem is solved and the Internal Server Error is fixed at this point.

Check .htaccess

Sometimes it can happen that the error is in the .htaccess. The file is usually located in the root directory of the WordPress installation on the server. To check whether the problem comes from the .htaccess, it is sufficient to rename the file to .htaccess_neu, for example. If everything is now displayed without problems when you reload your own page, the problem has been solved. If this is the case, the permalink structure must be saved again in the WordPress backend in order for WordPress to create a new, clean .htaccess.

If the case does not come from the .htaccess, the file is renamed back to its original name and the search for the error continues.

Increase PHP memory limit

Another reason why an internal server error pops up for every visitor to a website could be a PHP memory limit that is too low in the case of WordPress. WordPress is reaching its limits due to insufficient storage space. The problem can be solved by adding the line in wp-config.php directly after the opening

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

is inserted. This increases the storage space to 64Mb.

If the page can now be opened again after reloading, it is good that the error has been fixed, but at the same time this is only a temporary solution to the problem. At the same time, this means that a plugin or theme may be used that takes up too much storage space. In this case, it is advisable to contact the host of the site and use the server logs to get an idea of ​​which plugin is taking up how much storage space.

If this does not lead to a successful result either, the only option left is to exchange the WordPress core files.

Exchange WordPress core files

Before attempting to fix the internal server error by swapping WordPress files, a backup of the database and the entire FTP server should be made. Then you download WordPress in the same version that you are currently using for the site.

After that, all files in the two directories /wp-admin and /wp-includes are completely replaced with the new files. This has no effect on your own data, but can help to correct the error. It is important not to delete the files in the main directory /. exchange. In addition, no changes should be made to the files in the /wp-content directory.

Conclusion

If none of the above options help to get WordPress running again, the hosting company may be able to help further. The error may be found in the server logs and can be rectified.

Similar entries