WordPress 500 Internal Server Error

WordPress 500 Internal Server Error

WordPress has grown to become one of the most popular content management systems available today, powering literally millions of websites. It’s extremely versatile, has a huge support base, and doesn’t cost a thing, so everyone from humble bloggers all the way up to corporations now trusts it. Still, it sometimes does throw up errors that can be a bit of a challenge to fix, even using the copious amounts of documentation is available, and one such error is, “WordPress 500 Internal Server Error.” It’s quite a common one that can keep your site off-line if you don’t fix it, so if this is a position that you find yourself in, then you’ve come to the right place. Just follow the steps below and you should be back up and running in no time.

And please note that any time you’re thinking of making changes, make sure to back up your WordPress site and its MySQL database. It’s always best to ensure that you can recover your site if something goes wrong.

Enable debugging to fix WordPress internal server error

Debugging is always going to be a part of working with PHP, and WordPress comes with its own systems which simplify the process. You can enable debugging in WordPress by connecting to your server via FTP/SFTP or SSH. Once you’re in, edit the wp-config.php file. Just before the /* That’s all, stop editing! Happy blogging. */ line, add these lines:

define('WP_DEBUG', true);

define('WP_DEBUG_LOG', true);

WP_DEBUG is a PHP constant which triggers the debug mode in WordPress. WP_DEBUG_LOG ensures that all errors are saved in a log file called debug.log.

Save the configuration file and then whichever WordPress operation caused the WordPress 500 Internal Server Error, do it again. Look in the /wp-content/ directory. Locate the debug.log log file and check it for PHP errors, warnings, and notices. If you find any you can attempt to fix them.

You should ideally have the following code in your wp-config.php file:

Enable WP_DEBUG mode:

define( 'WP_DEBUG', true );

Enable Debug logging to the /wp-content/debug.log file:

define( 'WP_DEBUG_LOG', true );

Disable display of errors and warnings:

define( 'WP_DEBUG_DISPLAY', false );

@ini_set( 'display_errors', 0 );

Use dev versions of core JS and CSS files (only needed if you are modifying these core files):

define( 'SCRIPT_DEBUG', true );

Increase PHP memory limit in WordPress to fix internal server error

One of the most common causes for the 500 Internal Server Error message is hitting the PHP memory limit. This is normally set in the php.ini file, so you can try increasing the  memory_limit in php.ini and restart your Apache HTTP server / PHP-FPM service. Alternatively you can add the following line in your wp-config.php file:

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

In case your application is struggling under multiple active plug-ins and a heavy theme, requires, you can add memory by increasing the value here.

Create new .htaccess file

The .htaccess file can easily become corrupted by a bad plugin or from manual changes. Log in to your server via FTP/SFTP or SSH and rename the file to .htaccess.BAK or .htaccess.CORRUPTED,then create a new .htaccess file with the basic .htaccess settings.

Deactivate all plugins in WordPress to fix internal server error

If none of these approaches has worked yet, it may help to deactivate all your WordPress plug-ins. Go to the WordPress dashboard and find the Plugins section, then deactivate them, one at a time. Each time you do this you can refresh your site and then check to see if the problem has been solved.

If you don’t have access the WordPress dashboard you can still deactivate the plugins via FTP/SFTP or SSH. Log in to your server, go to your wp-content directory and rename the plugins directory to plugins.DEACTIVATED. Alternatively, you can go to the plugins directory and deactivate each plugin one by one. Do not forget to enable the plugins once you are done by renaming the plugins.DEACTIVATED directory to plugins again.

With any luck, one of these solutions will have helped you to fix the 500 Internal Server Error, but if not, then contact your web hosting provider for assistance.

WordPress Toolkit under Plesk Onyx – say goodbye to 500 internal server error

Hopefully this has helped you to fix the 500 internal server error and increased your understanding of WordPress. You can make your WordPress site faster and more reliable using the Plesk Onyx WordPress Toolkit extension, available as part of the Plesk Onyx hosting platform for your virtual or dedicated server. We designed it to simplify common tasks like configuration and routine management, and to make fixing issues like 500 internal server error much easier.

About

Elvis Plesky
Our fun and curious team mascot's always plugged into the latest trends. He's here to share his knowledge and help you solve your tech problems.

    Leave a Comment

    Start typing and press Enter to search