Are you seeing a 500 internal server error in WordPress?
The internal server error is one of the most common WordPress errors. Since the error doesn’t give any other information, many beginners find it quite frustrating.
In this article, we will show you how to easily fix the 500 internal server error in WordPress.
Here is a quick overview of the topics we will cover in this article:
- What Is the 500 Internal Server Error?
- What Causes the Internal Server Error in WordPress?
- Video Tutorial
- Fixing the 500 Internal Server Error in WordPress
- Clear WordPress and Browser Cache
- Checking for Corrupt .htaccess File
- Increasing the PHP Memory Limit
- Deactivate All WordPress Plugins
- Switch to a Default WordPress Theme
- Re-Uploading Core Files
- Enable Debug Logs in WordPress
- Ask Your Hosting Provider
What Is the 500 Internal Server Error?
The 500 internal server error is a common web server error. It is not specific to WordPress and can happen with any website.
The 500 in the error message is technically an HTTP error code. Looking up this code will only show its standard description:
“500 Internal Server Error response code indicates that the server encountered an unexpected condition that prevented it from fulfilling the request.“
This is a generic catch-all error message, which means that the server was unable to assign a better, more helpful error message when it encountered the issue.
The error page looks different depending on which web server software (Nginx or Apache) your website uses and which browser you use.
Here is how the Apache error page may look:
It may look different if you are using Nginx and Google Chrome.
It will also look different if Google Chrome is unable to find an error page to display:
For beginners, this can be incredibly frustrating. No clue or message will point them in the right direction to quickly fix it.
Asking how to fix an internal server error is like asking your doctor how to fix the pain you are experiencing without telling them where the pain is.
However, if you know the common causes that trigger this error, then you can try fixing them one by one to resolve the error without breaking anything.
What Causes the Internal Server Error in WordPress?
Internal server error in WordPress is often caused by a corrupt .htaccess file, poorly coded plugins, or your active WordPress theme.
Other possible causes of the internal server error in WordPress are PHP memory limit or corrupt core WordPress files.
In some conditions, the internal server error may only show up when you are trying to access the WordPress admin area while the rest of the site works fine.
That being said, now let’s take a look at how to go about troubleshooting the internal server error in WordPress.
Video Tutorial
Subscribe to WPBeginner
If you prefer written instructions, then just continue reading.
Fixing the 500 Internal Server Error in WordPress
Before you begin troubleshooting, make sure that you have a complete WordPress backup of your website on hand.
If you have access to the WordPress admin area, then you can use a WordPress backup plugin to create a complete backup of your website. We recommend using Duplicator to handle this.
On the other hand, if you don’t have access to the WordPress admin area, then you can manually create a WordPress backup using phpMyAdmin and an FTP client.
After that, you can follow the following steps to troubleshoot and fix the internal server error on your website.
Clear WordPress and Browser Cache
Browsers and your WordPress caching plugins can sometimes mistakenly store a cached copy of an error page.
The easiest way to fix this is by first clearing your browser cache.
After that, if you have access to the WordPress admin area of your website, then you can empty the WordPress cache by visiting your caching plugin’s settings page.
For details, see our tutorial on how to clear WordPress cache.
Checking for Corrupt .htaccess File
The .htaccess file is a server configuration file that is also used by WordPress to set up redirects.
One of the most common causes of the internal server error is the corrupt .htaccess file.
The easiest way to fix this is by simply visiting the Settings » Permalinks page in the WordPress admin area and then clicking on the ‘Save Changes’ button without making any changes at all.
WordPress will now try to update your .htaccess file or generate a new one for you. You can now visit your website to see if this has resolved the internal server error.
If you can still see the error, then you need to make sure that WordPress was able to generate or write to the .htaccess file.
Sometimes, due to file and directory permissions, WordPress may not be able to create or write to your .htaccess file.
You can now try to replace the .htaccess file manually. First, you need to log in to your website using FTP or the File Manager app under your hosting account control panel.
Next, you need to rename your main .htaccess file to something like .htaccess_old. This lets you keep the file as a backup, but WordPress won’t recognize it.
To rename the .htaccess file, you will need to log in to your site using FTP or the File Manager app in your hosting account’s cPanel dashboard.
Once you are connected, the .htaccess file will be located in the same directory where you will see folders like wp-content, wp-admin, and wp-includes.
Simply right-click on the .htaccess file and rename it to .htaccess_old.
Next, you need to create a new .htaccess file.
Inside your site’s root folder, right-click and then select the ‘Create new file’ option in your FTP client or File Manager app.
Name this new file .htaccess and click ‘OK’ to save it.
Now, this .htaccess file is currently empty, and you need to add default WordPress rewrite rules to it.
Simply right-click on the file and then select ‘View/Edit’ in your FTP client or File Manager app.
The empty file will open in a plain text editor like Notepad or TextEdit.
Now, you need to copy and paste the following code inside it:
# 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
This code is the default rule set used by WordPress. Don’t forget to save your changes and upload the file back to the server.
You can now visit your website to see if this has resolved the internal server error.
If it did, then give yourself a pat on the back because you fixed the internal server error.
Important: Before you move on with other things, make sure that you go to the Settings » Permalinks page in the WordPress admin area and click the Save button without making any changes. This will regenerate the .htaccess file for you with proper rewrite rules to ensure that your post pages do not return a 404 error.
If checking for the corrupt .htaccess file solution did not work for you, then you need to continue reading this article.
Increasing the PHP Memory Limit
Sometimes, the internal server error can happen if a script consumes all the PHP memory limit.
The easiest way to increase the PHP memory limit is by editing the wp-config.php file. Be careful when you do this if you are a beginner. You want to follow these instructions carefully because even small mistakes in WordPress core files can break your site.
To begin, simply connect to your WordPress website using an FTP client or the File Manager app under your hosting account control panel.
You’ll find the wp-config.php file inside the main folder of your website. Right-click on it and select ‘Download.’ This will ensure that you have a file backup in case something goes wrong.
When you’ve saved that, you can right-click on it and select ‘View/Edit.’
Inside the wp-config.php file, you need to add the following code just above the line that reads, ‘That’s all, stop editing! Happy publishing’:
define( 'WP_MEMORY_LIMIT', '256M' );
For more details, see our tutorial on how to increase the PHP memory limit in WordPress.
Note: If 256M doesn’t solve the problem, then try increasing it to 512M.
If you see the internal server error only when you try to log in to your WordPress admin or upload an image in your wp-admin, then you should increase the memory limit by following these steps:
- Create a blank text file on your computer and name it php.ini
- Paste this code in there: memory=256MB
- Save the file
- Upload it into your /wp-admin/ folder using FTP
If increasing the memory limit fixed the problem for you, then you have only fixed the problem temporarily. You still need to find the cause that is exhausting your memory limit.
This could be a poorly coded plugin or even a theme function. We strongly recommend that you ask your WordPress web hosting company to look into the server logs to help you find the exact diagnostics.
If increasing the PHP memory limit did not fix the issue for you, you are in for more troubleshooting.
Deactivate All WordPress Plugins
If none of the above solutions worked for you, then this error is most likely being caused by a specific plugin installed on your website.
It is also possible that it is a combination of plugins that are not playing nice with each other.
If you can access the WordPress admin area of your website, then you can simply go to the plugins page and deactivate all WordPress plugins.
However, if you are unable to access the WordPress admin area, then you can deactivate all WordPress plugins using FTP.
Simply connect to your WordPress website using an FTP client or the file manager app under your hosting account control panel.
Once connected, navigate to the /wp-content/ folder and rename the plugins folder to plugins.deactivated.
WordPress looks for plugins in the plugins folder. If the plugins folder is not found, it will automatically deactivate all plugins.
You can now try visiting your website to see if this resolved the internal server error on your website.
To restore all your plugins, you can simply rename the ‘plugins.deactivated’ folder back to plugins.
Your plugins will now be restored, but they will still be deactivated.
You can now activate plugins individually and visit your website to figure out which plugin is causing the internal server error.
For more details, see our guide on how to deactivate all WordPress plugins without WP-Admin.
If deactivating all plugins didn’t fix the internal server error on your website, then continue reading.
Switch to a Default WordPress Theme
One possible cause of the internal server error could be some code in your WordPress theme.
To determine if this is the case, you need to switch your theme to a default WordPress theme.
If you have access to the WordPress admin area, then go to the Appearance » Themes page. If you have a default theme already installed, then you can simply click on the Activate button to switch the theme.
If you don’t have a default theme installed, you can click on the ‘Add New’ button at the top and install a default theme (Twenty Twenty-Three, Twenty Twenty-Two, and so on).
If you don’t have access to the WordPress admin area, you can still switch to a default theme.
Simply connect to your WordPress website using an FTP client and navigate to the /wp-content/ folder.
Right-click to select the themes folder and download it to your computer as a backup.
Next, you need to delete the themes folder from your website. Once it is deleted, go ahead and create a new themes folder.
Your new themes folder will be completely empty, which means you don’t have any WordPress themes installed at the moment.
Next, you need to visit the WordPress themes directory and download a default WordPress theme to your computer.
Your browser will then download the theme as a zip file to your computer.
Locate the file on your computer and then unzip it. Windows users can unzip the file by right-clicking on it and then selecting ‘Extract All’. Mac users can double-click on the zip file to extract it.
You’ll now see a folder containing your WordPress theme.
Switch back to your FTP client or File Manager up and upload this folder to the empty themes folder.
Once uploaded, WordPress will automatically start using the default theme.
You can now visit your website to see if this resolved the internal server error.
If this didn’t work, then you can reupload your WordPress themes from the backup or switch back to the theme you were using.
Don’t worry. There are still a few more things you can do to fix the error.
Re-Uploading Core Files
If the plugin and theme options didn’t fix the internal server error, then it is worth re-uploading the /wp-admin/ and /wp-includes/ folders from a fresh WordPress install.
This will NOT remove any of your information, but it may solve the problem in case any file is corrupted.
First, you will need to visit the WordPress.org website and click on the ‘Download’ button.
This will download the WordPress zip file to your computer.
Go ahead and extract the zip file. Inside it, you will find a wordpress folder.
Next, you need to connect to your WordPress website using an FTP client.
Once connected, go to the root folder of your website. It is the folder that has the wp-admin, wp-includes, and wp-content folders inside it.
In the left column, open the WordPress folder on your computer.
Now you need to select all files inside the wordpress folder and upload them to your website.
Your FTP client will now transfer those folders to your server.
It will ask you whether you would like to overwrite the files. Select ‘Overwrite’ and then select ‘Always use this action’.
Your FTP client will now replace your older WordPress files with new, fresh copies.
If your WordPress files were corrupted, then this step will fix the internal server error for you.
Enable Debug Logs in WordPress
WordPress comes with a built-in system to keep logs for debugging.
You can turn it on by using the WP Debugging plugin. For more details, see our guide on how to install a WordPress plugin.
Once activated, the plugin will turn on debugging logs on your WordPress website.
If you don’t have access to the admin area of your WordPress website, then you can turn on debugging by adding the following code to your wp-config.php file:
define( 'WP_DEBUG', true); define( 'WP_DEBUG_LOG', true);
Once you have turned on debug logs, you can view these logs by using an FTP client and navigating to the /wp-content/ folder.
You can open the debug log file in a text editor, and it will show you a list of errors and warnings that occur on your website.
Some errors and warnings can be harmless incidents that may not need fixing. However, if you are seeing an internal server error on your website, then these may point you in the right direction.
Ask Your Hosting Provider
If all methods fail to fix the internal server error on your website, then it is time to get some more help.
Contact your web hosting support team, and they will be able to check the server logs and locate the root cause of the error.
If you want to continue troubleshooting on your own, then see our ultimate WordPress troubleshooting guide for beginners.
We hope this article helped you fix the internal server error in WordPress. You may also want to see our complete list of the most common WordPress errors and our guide on how to choose the best web hosting provider.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here’s our editorial process.
Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.
Seeing a 500 internal server error where your website should be is enough to throw anyone into a panic. When your website goes down, you lose out on potential traffic and sales. If it’s offline for a while, it can also negatively impact your Search Engine Optimization (SEO) efforts.
Fortunately, there are plenty of ways to go about fixing this error. Many of these solutions are fairly straightforward, and you don’t need a lot of technical know-how to start troubleshooting.
In this guide, we’ll cover what the 500 internal server error in WordPress is and discuss some potential causes. Then we’ll give you 10 tips to help you get your website back in working order.
- Back up your website.
- Try reloading the page.
- Clear your browser cache.
- Access your error logs.
- Check for the “Error Establishing a Database Connection.”
- Look for permission errors.
- Increase your PHP memory limit.
- Check for problems with your .htaccess file.
- Look for coding or syntax errors in your CGI/Perl script.
- Ask your web host about potential server issues.
Let’s get started!
Dealing with the WordPress Internal Server Error?
Avoid troubleshooting when you sign up for DreamPress. Our friendly WordPress experts are available 24/7 to help solve website problems — big or small.
What Is the 500 Internal Server Error?
The 500 internal server error is frustratingly nonspecific. When the error occurs, you usually don’t get many details about it. In fact, you might not receive any information at all.
The 500 error is a generic issue that isn’t specific to WordPress. Chances are you’ve seen it before during your internet explorations. Despite the name, it doesn’t necessarily mean that something is wrong with your server. It could be an issue with your website or browser.
If you do see this error on your site, you’ll want to get it fixed as quickly as possible. A 500 error can impact your SEO if allowed to linger. If your site is crawled while it’s offline, there’s a chance that Google may interpret the error as an issue with your website.
This error can also hurt your User Experience (UX) and give visitors the impression that you’re unprofessional. Not only can a poor UX affect the way Google ranks your site, but it can cause you to lose customers as well. After all, you can’t do business if your site isn’t accessible.
A wide variety of situations can result in the 500 error, making it a bit of a chore to sort out. Potential causes of the 500 internal server error in WordPress include:
- Plugin compatibility issues
- Exhausted PHP memory limit
- Corrupted files
- Coding or syntax errors
The fact that the error message itself tends to be vague doesn’t help. Fortunately, you can solve many of these issues on your own with a bit of know-how.
Variations on the 500 Internal Server Error
Depending on your operating system, browser, and the cause of the error, there are variations in how it will appear. For example, if a database connection can’t be established, you might see something like this:
A plain white screen, sometimes referred to as the White Screen of Death (WSoD), can indicate a 500 internal server error.
Also, many site owners have the option to customize their 500 error messages. So you might see this error in many different forms.
How to Fix the 500 Internal Server Error in WordPress (10 Tips)
Now that you’ve had an introduction to the 500 internal server error, it’s time to discuss how to resolve it. Let’s take a look at ten tips you can use to fix this issue in WordPress.
1. Back up your website.
Before tinkering under the hood, it’s always smart to make a backup of your website. If DreamHost hosts your site, you can take advantage of our one-click backup feature. You can also create a manual backup if you prefer.
To make a complete backup, you’ll need to save copies of your WordPress files as well as your databases. You can back up your site’s files using a Secure File Transfer Protocol (SFTP) client such as FileZilla.
Once you’re connected to your server, navigate to the WordPress files you want to save. These files include the WordPress core installation, plugins, themes, images, and more. To save the files, simply right-click on them and select Download.
Now you’ll need to back up your database, which you can do by logging into phpMyAdmin. Select the database you want to download from the left-hand panel, and then click on the Export tab.
You’ll then need to choose between a “Quick” or a “Custom” export. The Quick export will likely work just fine unless you need to manage more advanced options.
Click on the Go button, and your download should start. Once your website is safely backed up, you can get to work on fixing that 500 error.
2. Try reloading the page.
Let’s start with the best-case scenario. Some situations that cause a 500 internal error clear up on their own within a few minutes. For example, if you’ve just made changes to a plugin or theme, or if your host is experiencing unusually heavy traffic, you may see a server error. If this is true in your case, you’re in luck, as a simple page reload should get things back to normal.
Therefore, the first thing to try is simply waiting a minute or two, during which the error will hopefully resolve itself. Then you can try reloading the page by pressing F5 or (command + R if you’re using a Mac).
3. Clear your browser cache.
Another potential server error fix that’s quick and easy is clearing your browser cache. It’s possible the cache became corrupted, which would cause problems when attempting to access websites.
First, you might check Down For Everyone Or Just Me. This will determine whether there’s a widespread problem or you’re the only one experiencing difficulties.
If you’re alone in your 500 error frustration, the problem may be your browser. Try accessing your site from a different browser. If an alternative works, it’s a sign that the issue is with your cache.
In Google Chrome, you can clear your cache by pressing Ctrl + Shift + Delete. Alternatively, you can click on the three vertical dots in the top-right corner, followed by More tools > Clear browsing data.
Be sure to check the Cached images and files box. Then click on the Clear data button.
In Firefox, you can clear the cache using the Ctrl + Shift + Delete keyboard shortcut. This will open the Clear Recent History window. In the Time range to clear drop-down menu, select Everything. Check the Cache box, and then click on OK.
In Safari, you can navigate to the History menu item and choose Clear History. Keep in mind that this will delete everything, including cookies and visited pages.
Once you’ve cleared your browser cache, you can attempt to access your website again. If you’re still seeing the 500 internal server error, it’s time to move on to more involved fixes.
4. Access your error logs.
Your site’s error logs may provide insight into what’s causing the 500 error. Depending on your host, these logs may be cycled quite often, so you’ll want to take a look as soon as possible.
You can check your error logs by accessing your site’s files via SFTP and looking for the /logs directory. Next, select the site that’s experiencing the error. You may see several directories at this point. You’ll want to check the one with the most recent date.
You can view the log by downloading it and opening it with your preferred text editor. Hopefully, your error logs will provide you with some additional context for the 500 error.
Another option is to enable the WordPress debug log. You can do this by connecting to your site via SFTP and opening your wp-config.php file. Within it, look for the following line:
define('WP_DEBUG', false);
Once you find it, replace it with the following:
define( 'WP_DEBUG', true ); define( 'WP_DEBUG_DISPLAY', false ); define( 'WP_DEBUG_LOG', true );
This will create a debug.log file, which you can find under the /wp-content/ directory. Just be sure to change the WP_DEBUG value back to “false” when you’re done troubleshooting.
5. Check for the ‘Error Establishing a Database Connection.’
If there’s been a problem establishing a database connection, not only will your site be offline for visitors, but you won’t be able to access the WordPress admin dashboard either. There are a few possible causes of this:
- Incorrect database login credentials
- A corrupted WordPress database
- A corrupted WordPress installation file
Let’s start with incorrect login credentials, as this is a common cause of the database connection error. If you’re a DreamHost user, you can find your database credentials in your panel. However, if you use a different host, you’ll likely follow a similar procedure.
Navigate to MySQL Databases and find the one that corresponds to your website under the Database(s) on this server section. Here, you’ll find your database name under the Database heading. The username is listed under the Users Access column.
Alt-text: Where to find your MySQL username in DreamPanel.
To find the password, click on the username. On the next screen, scroll down and click on the Show button next to the password field.
Next, you’ll compare these credentials to those in your wp-config.php file. You can access this file in your site’s main directory via SFTP. Once you have the file downloaded, open it and verify that the information under MySQL Settings matches what you found in your panel.
Next, if your database is corrupted, you can quickly repair it through phpMyAdmin. Log in and click on your database in the left panel. Select all of the tables in the database, and then choose the Repair table option from the drop-down menu.
Finally, let’s look at how to handle a corrupted WordPress installation file. Start by downloading a new copy of WordPress and unzipping the file. You’ll need to delete the wp-content folder and the wp-config-sample.php file.
Upload the rest of the files to your site via SFTP, overwriting any existing ones. You now have a brand new, uncorrupted WordPress installation. You’ll also want to clear your browser cache before checking your website again.
6. Look for permission errors.
If any of your files have permissions set incorrectly, you may see the 500 internal server error as a result. Again, you can check and change these permissions using SFTP.
Right-click on any file and select File permissions to open a new dialogue window. In this window, you can check and, if necessary, set new permissions for the file.
Typically, you’ll want to set files to “644” and directories and executables to “755”. However, you may want to check with your host if you’re unsure about the correct values.
7. Increase your PHP memory limit.
Another reason you might see the 500 internal server error is if you’ve exceeded your server’s PHP memory limit. There are several ways to increase your limit, and they all involve using SFTP.
Before you try increasing your memory limit, you may want to start by seeing what it’s currently set to. You can do this through the WordPress admin dashboard. Keep in mind that, with some variations of the 500 error, you won’t be able to access the dashboard. If that’s the case, you may have to skip this step.
From your WordPress dashboard, navigate to Tools > Site Health. Click on Info at the top of the screen, and scroll down to the Server section. You should see your PHP memory limit there.
To increase the PHP memory limit, there are a few files you can edit. One is your .htaccess file, typically located in your site’s root directory. Open the file and add the following code:
php_value memory_limit xxxM
You can replace the “xxx” with your desired amount of memory. Usually, 256M is plenty.
You can also increase your memory limit by editing your php.ini file. You should be able to find this file in your root directory. If not, you can go ahead and create one. Add or update its code to the following:
memory_limit = xxxM
Another option is to add in the following code at the top of your wp-config.php file:
define('WP_MEMORY_LIMIT', 'xxxM');
If this resolves the 500 error, your next task will be to figure out what is causing the memory limit exhaustion. It could be a problematic plugin or theme. You might consider reaching out to your host for help on finding the exact server diagnostics.
8. Check for problems with your .htaccess file.
Your .htaccess file is one of the core WordPress files. It contains rules for your server, so it could contribute to a 500 internal server error.
If your .htaccess file has become corrupted, you’ll want to go ahead and create a fresh one. Start by logging into your site via SFTP and finding your .htaccess file. Rename the file to .htaccess_old.
Now, create a new .htaccess file in your text editor and paste in the following:
# BEGIN WordPress RewriteEngine On RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] # END WordPress
Go ahead and upload your newly created .htaccess file. Then refresh your site in your browser, and check to see whether the error message is showing.
9. Look for coding or syntax errors in your CGI/Perl script.
If you’re running Common Gateway Interface (CGI) scripts, any coding errors you’ve made could result in a 500 error. To unearth potential issues with your CGI scripts, log into your site using Secure Shell Access (SSH).
Once you’ve logged in, you can troubleshoot your CGI with this command:
[server]$ ./cgi_name.cgi
The terminal should return a general error message and the line number the culprit is located on. From there, you can work your coding magic!
When working with CGI, there are a few best practices to keep in mind to avoid problems. First, it’s wise to use a plain text editor to ensure that you maintain ASCII format. When you upload scripts, you should also be able to select ASCII mode in your FTP client.
Finally, if necessary, upload to the cgi-bin directory on your server. Then you can double-check your files’ permissions once you have them uploaded.
10. Ask your web host about potential server issues.
If all else fails, there may be a server issue, which only your host can confirm. Unfortunately, if your host’s server is experiencing a problem, you may have to wait out some website downtime.
If you’re a DreamHost client, you can check the DreamHost Status page. This resource provides you with information on all of our services.
If you run into any problems while trying to repair the 500 internal server error, you can always reach out to our tech support team. They’re ready and waiting to lend you a hand! If you’ve followed the tips in this guide, you’ll have plenty of valuable information for the technician.
Get Content Delivered Straight to Your Inbox
Subscribe to our blog and receive great content just like this delivered straight to your inbox.
Additional WordPress Error Reading
Want to learn more about fixing common WordPress errors? We’ve put together several tutorials to help you if you encounter any other issues.
- How to Fix Syntax Errors in WordPress
- How to Fix the WordPress Not Sending Email Issue
- How to Fix the Error Establishing Database Connection in WordPress
- How to Fix WordPress Error 404 Not Found
- How to Fix the Sidebar Below Content Error in WordPress
Let’s Get Your WordPress Website Back on Track
While having to sort out a 500 internal server error isn’t exactly fun, it’s also not as painful as you might imagine. With a little patience and the tips we’ve provided, you should be able to make some progress on getting your website back online.
You can start small by refreshing your page and clearing your browser cache. Then you might want to move onto more involved fixes, such as increasing your PHP memory limit. If you’re not able to resolve the error on your own, DreamHost’s award-winning tech support is just a click away.
When you do run into errors, it’s easier to get back up and running when you have a reliable hosting provider. DreamPress is fast, secure WordPress hosting with powerful features to help make your site a success!
Updated on
http error 500 wordpress
So, out-of-the-blues there is a 500 Internal Server Error in WordPress is one of those common wordpress errors that create the most panic because, when it arrives, we usually have no idea why. But, rest assured, it is very common and can be solved. One of the most common reasons for this error is your .htaccess file. We will talk about this and few other things to fix wordpress 500 internal server error.
Are you getting Error 500 message when trying to access wp-admin dashboard or after changing url ?
Are you not able to log into admin page (HTTP 500 error)?
Fixing 500 internal server error will require troubleshooting that will take time and patience. This in depth tutorial on how to fix 500 internal server error in wordpress is created especially in order to offer some advice for those who encounter this problem, but also to give solutions to fix it.
There are a few common causes, such as having a corrupted .htaccess file, exceeding your PHP memory limit, and having improper file permissions.
Few other common wordpress errors you might need help with.
- WordPress White Screen of Death (WSOD) Error
- Incorrect WordPress File And Folder Permissions Error
- “The link you followed has expired” in WordPress error
- Pluggable.php File Errors WordPress
- Upload: Failed to Write File to Disk WordPress Error
- Are You Sure You Want to Do This Logout Error WordPress
- HTTP Image Upload Error WordPress
- 503 Service Unavailable Error in WordPress
- WordPress Stuck in Maintenance Mode
- Parse Error: Syntax Error Unexpected in WordPress
- This Account Has Been Suspended WordPress issue
- Error Establishing a Database Connection in WordPress
- Sorry, This File Type Is Not Permitted For Security Reasons WordPress issue
What is a 500 internal server error in WordPress?
500 Internal Server Error is a common error message that indicates a PHP error or server problem. The 500 internal server error in wordpress is caused by the installation of an incompatible plugin, a plugin that uses too much memory, or any other plugin that causes conflict with the current setup of the site.
For example, recently I had to remove a spammy plugin and then reinstall it to fix 404 not found errors. Then after it was working fine again, I had to remove it again because I was getting 500 Internal Server Error in WordPress.
To fix this error you will have to first troubleshoot the problem and eliminate possible causes until you get rid of this problem. For more info on what causes 500 internal server error please read my previous article: What causes 500 Internal Server Error in WordPress
On the “Internal Server Error” page it says “The website encountered an unexpected condition which prevented it from fulfilling your request.”
This means that your request was processed by the server but due to some reason was not fulfilled properly. This could be due to several factors including:
A 500 Internal Server Error error message suddenly appears on your site when this occurs. There are many causes that can cause it, namely the error configuring the .htaccess file, the contradiction of sessions, very slow loading of the site, the addition of a new file or a new folder on the server or still using too many resources on the server.
This message also appears in the event of an incorrect configuration of a theme or plugin. There are still other causes, but what we have just mentioned are the most frequent. To be able to repair them quickly and efficiently, you must first discover their origin.
Error 500 is an internal server error commonly encountered on WordPress and other sites. When this happens, the 500 Internal Server Error message will appear on your site.
Causes of Error 500 WordPress internal server error
First, let’s discuss some of the causes of HTTP 500 error. If you are getting this error after updating your site, it could be a result of a bad plugin or theme. Deactivating plugins and themes one by one until the error goes away will help you identify the problematic add-on. If you delete any plugin or theme without removing its files properly through FTP, chances are that you will end up with corrupted files which might cause this error to appear. Make sure that you also clear your cache when deleting plugins and themes to improve the performance of your site.
Case 1:
The most frequent cause is a configuration error in the .htaccess file. This is the procedure by which we always start when error 500 occurs since it only takes a few minutes to correct.
Case 2:
When the error appears intermittently and the loading of the site is very slow. Conflicting sessions may be the source of this error. Another reason could be that the WordPress site is using too many resources on the server.
Case 3:
Error 500 appears when you have just added a new file or folder to your server. In this case, the new file or folder does not have the correct authorization number.
The error may have other origins, including a plugin or a misconfigured theme, but it would be complex to name them all here. WordPress site owners who are unfamiliar with 500 error correction are always recommended to seek the help of an expert who could assist with this task.
Obviously, there is always a risk of creating another more serious bug when trying to correct a WordPress error.
The 500 internal server error messages can be viewed in many ways because each website is allowed to customize the message.
Variations for 500 Internal Server Errors
- 500 internal server error
- HTTP 500 – Internal server error
- Temporary Error (500)
- Internal server error
Because the website you’re visiting is causing an error on 500 internal servers, you could see it on any browser on any operating system, even on your smartphone.
In most cases, 500 internal server error in wordpress are displayed in the browser window, as are web pages.
Now, the million-dollar question, what causes the “500-Internal Server Error”?
“Well, There Is No One Word Answer Here.”
As we mentioned above, internal server error messages indicate that something is wrong overall.
In most cases, “wrong” means programming a page or site, but it is likely that the problem is at your disposal, which we will investigate below.
More specific information about the causes of a specific HTTP 500 error is often provided when it occurs on a server that uses Microsoft IIS software. Look for numbers after 500, such as HTTP Error 500.19 – Internal Server Error , which means that the configuration data is incorrect.
A server-side error can happen owning to a variety of factors, spanning from a minute bug into the code to the incorrect uploading of the file.
However, the two most common causes of this WordPress error is the corrupted .htaccess file and second reason, when you’ve exceed the PHP memory limit.
The “.htaccess file” happens whenever you make any change at the backend of the website, like installing a new plugin or modify the error.
On the other hand, the “PHP memory limit” is a scenario when your website has poorly-codded plugins or too many plugins installed.
In many cases, the error 500 is caused by a failure in the .htaccess file of your website.
This does not mean that you have caused it by editing that file, but it may have been due to some process that has been carried out on your website.
How to Fix 500 Internal Server Error WordPress ?
A solution would be to upgrade your web hosting plan. If you are using a shared hosting package, your site might be overloaded due to high traffic and that might lead to this error. It’s important to monitor the amount of resources consumed by different websites hosted on a single server because it can cause serious issues if a single website is overloading the server.
You should also check whether .htaccess file has been edited in any way or not. Sometimes editing .htaccess file can lead to this issue because it is responsible for URL rewriting and rewrites can easily mess up with WordPress core files.
.htaccess file error –
If your .htaccess file is improperly named or has been replaced by another file (such as .htaccess.txt), then you may see the 500 Internal Server Error when trying to access your site.
Solution: Delete any files with the name .htaccess and rename your current .htaccess file to .htaccess.bak so that it doesn’t get overwritten when you upload a new one. Then, upload a new .htaccess file from this article: How To Fix WordPress When You Get A Failed To Open Stream Error Or File Not Found. If you don’t want to mess with an FTP client and can’t log into your server via cPanel, try using these instructions instead: How To Fix WordPress Permalinks When You Get A Failed To Open Stream Error Or File Not Found.
Misconfigured .htaccess file
Look for the .htaccess file on your WordPress site server, then simply change the file name to old.htaccess. This will correct the error in 90% of the cases. If this procedure does not work, try the following.
These are the rules shown in the image above:
#BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
#END WordPress
Loading of the site is slow and the error appears intermittently:
Start by deleting the active sessions of your website in your browsing history. If that doesn’t fix the problem, check the error logs and find the source of the 500 error, then check the resource usage in the FTP server.
New file or folder added to the server:
Just change the authorization number for the new file. Find the file (or files) you just added to your server, click the right button of your mouse, then change the authorization number to 644. If it is a folder, change it number for 755.
Each WordPress error has its own way of fixing!
The 500 WordPress error can appear at any time. You should no longer be surprised when you experience this problem. Of course, this error can panic a WordPress beginner. On the other hand, the more you panic, the more the problem will seem huge to you.
The first reflex that you must have when faced with such a situation is therefore to find the cause that may well have triggered this error. Once the origin is detected, you can repair it by following these few tips:
In case of an incorrect configuration of the .htaccess file, you must search for this file on the server of your WordPress site. Once found, simply rename the file to old.htaccess and the error will be corrected automatically in 90% of cases. If the repair was not successful, you can proceed with other techniques.
Check if a new file or folder has just been added to your server. If this is the case, you only have to change its authorization number by clicking the right mouse button on the file found. The authorization number is 644 for a file and 755 for a file.
The other technique is dedicated to repairing an error that appears intermittently after a slow site load. In this case, you must first delete all active sessions from your website that are in your browsing history. In some cases, this is enough to resolve the problem. If not, we recommend that you check the error logs and look for the source of the 500 error so that you can check the resource usage in the FTP server.
If none of these solutions is chosen, do not hesitate to ask your hosting provider for help. You just need to open a technical ticket via the “support” section of your customer area. Thanks to the server logs that the latter keeps, he has every right to get to the bottom of things.
You should know that if you access your WordPress installation through the CPanel of your hosting or by FTP you will find a file called php_errorlog.Php_errorlog file
There you will see a list of errors sorted by the date that can give you a clue to locate the problem.
But since it is an internal server error it may be difficult to interpret the problem so let’s see what steps to take to fix it.
Enable Debugging
To see whether this is the case, you’ll need to edit the wp-config.php file in your website’s root directory. Download the file (via FTP), open it (using a text editor) and search for ‘WP_DEBUG’. If you find the line, simply change false to true and re-upload the file to the server.
If this line isn’t yet in your config file, create it using the following line of code:
define( "WP_DEBUG", true );
Reload your website and see if the error changes.
Methods to fix 500 internal server error wordpress
Error 500 by the .htaccess
We have already seen that the most common is that the error 500 occurs because the .htaccess file is damaged. So we will start here.
Step 1
To check if the error is there, access the files of your WordPress installation (here is a tutorial on how to do it by FTP) and locate the .htaccess file
If you don’t see it, it may be hidden. In that case, you must search among the menus of your FTP program to make the hidden files visible (it is usually in the View menu).
Step 2
As soon as you find it, rename it. For example: .htaccess.old
Rename htaccess
Now go to your website and reload to see if the error has disappeared.
If you have, it is because the internal server error (or error 500) was caused by a failure in the .htaccess. Now follow the instructions in step 3.
In case the error persists, leave the name of the file .htaccess as it was at the beginning and read the solutions below.
Step 3
You must generate a new .htaccess file. To do this, in your WordPress administration panel, go to Settings> Permanent Links and click save changes.
Save permalinks
That will generate a new error free .htaccess file.
Internal server error 500 due to plugins
If the problem was not in the .htaccess it may be in one of the plugins.
Step 1
If you just installed a plugin and the error occurred at that time, you have it easy. Uninstall it and everything will return to normal.
Step 2
But sometimes it is not so easy to locate the problem and it may be due to conflicts between two or more plugins.
In that case, you will have no choice but to disable all plugins. If you do not have access to the WordPress administration panel, you must access it by FTP.
One trick to disable all plugins at once is going to the wp-content folder and rename the folder plugins to plugins.deactivate
If the 500 error has disappeared, and you can access the administration panel, you will know that it was caused by one of the plugins.
Step 3
Now go activating them one by one again and checking if any of them give an error. This way you will find the plugin that is causing the scare and you can find an alternative to it.
If you haven’t fixed error 500, read on.
HTTP 500 Error due to theme
If you have not solved the error, the cause may be your WordPress theme. Activate any other theme, for example, one that WordPress has by default.
If the problem persists, read on.
Error 500 Due to damaged folders
If you have tried all the steps above and the problem persists you may have to repair the wp-admin and wp-includes folders .
Don’t worry because this will not delete any information from your website.
To repair them you just have to download the latest version of WordPress from wordpress.org, unzip the .zip file, copy the wp-admin and wp-includes folders and replace them with those from your website.
WordPress error 500 due to memory limit
If you have followed all the steps above and the error still persists, it could be a memory problem on the server.
For some reason (that your hosting provider can explain) something is causing your server memory to run out.
To fix it, it should be enough to increase the memory limit.
For this you can create a text file called php.ini and include the following code in it:
memory = 128MB
Then save the file in the / wp-admin / folder of your WordPress installation.
To make your task easier, you can directly download the prepared php.ini file here.
Another option is to edit the wp-config file of your WordPress installation, adding the following line of code:
define ('WP_MEMORY_LIMIT', '128M');
Check File Permissions
In your directory, WordPress permissions for folders and files should be 755 or 644. Setting permissions to anything else may cause problems, including 500 internal server errors.Make sure these are not set to anything other than 755 or 644.
The first thing to do to fix a WordPress 500 error the first time is to check the .htaccess file. When you have changed the file name, load the site to see if everything is set or not. In case of failure, it is advisable before moving on to something else to go to “Settings”, then to “Permalinks” found in your WordPress dashboard. Then click on the “Save” button which allows you to create a new file.
Among the other methods that you should adopt to repair a WordPress 500 error is increasing the memory limit size of PHP. Please note that this type of error may appear if your PHP memory limit is exhausted. To increase the memory limit size of PHP, the first thing to do is to create an empty text file called php.ini.
Then, you will paste this code into the file memory = 64MB. After saving the latter, launch the download in your folder/wp-admin/via FTP. If the memory limit is exhausted, it means that there is something that consumes your memory largely.
This remains to be determined so that the problem of this kind does not repeat itself. Be aware that this may well be a theme function or a poorly coded plugin. Only your hosting company can help you perform accurate and precise diagnostics by looking in the server logs.
Contact your HOST
Still cannot find a solution, your host may have it. it’s important that you go through all of these steps so you can explain to them that you’ve checked every nook and cranny of your file system and can’t find a single issue that would lead to the 500 internal server error that’s running on your site.ask them to check their server logs to see if the issue is there.
If you still get a 500 Internal Server Error on WordPress, the server is not working and you can go back to the host and provide them this URL stating it should load as it is only a 1 line file that does not depend on anything to load.
WordPress Core Issue
Your core WordPress installation may have an issue. This could be files missing, changed or corrupted. You want to make sure that your core WordPress installation is fresh and new to rule out this being the cause of your server WordPress 500 Internal Server Error.
Manually remove and re-install WordPress core files.
- Get the latest WordPress zip (or tar.gz) file.
- Unpack the zip file that you downloaded.
- Deactivate plugins.
- Delete the old
wp-includes
andwp-admin
directories on your web host (through your FTP or shell access). - Using FTP or your shell access, upload the new
wp-includes
andwp-admin
directories to your web host, in place of the previously deleted directories. - Upload the individual files from the new
wp-content
folder to your existingwp-content
folder, overwriting existing files. Do NOT delete your existingwp-content
folder. Do NOT delete any files or folders in your existingwp-content
directory (except for the one being overwritten by new files). - Upload all new loose files from the root directory of the new version to your existing wordpress root directory.
NOTE – you should replace all the old WordPress files with the new ones in the wp-includes
and wp-admin
directories and sub-directories, and in the root directory (such as index.php, wp-login.php and so on). Don’t worry – your wp-config.php will be safe.
Switch to a Default Theme
If deactivating your plugins didn’t solve the issue, it’s likely your theme’s the culprit. You can verify this easily by switching to a default WordPress theme. I recommend using Twenty Sixteen, which is the latest default theme. If switching to Twenty Sixteen solves the problem, you can re-enable all plugins and get to work finding the issue in your theme’s code.
PHP Version Issues
While old PHP versions usually don’t cause 500 internal server errors, it may be worth talking to your host and asking them to give you a newer version before spending valuable time and money
Ask your host what version of PHP you’re running.
Disabling all plugins in case of 500 error in WordPress
If none of the solutions mentioned above are effective, it can probably mean that the problem is caused by a specific plugin. As it will be difficult to detect, deactivating all WordPress plugins at the same time is, therefore, the best solution.
Then activate the extensions one by one until you find the plugin that caused the error.
Once detected, get rid of it and don’t forget to report it to its author. If this option to deactivate extensions could not fix the error, you can return the basic files, i.e. change the wp-includes and wp-admin files to new ones. This can be useful if a file has been corrupted.
If you are unable to resolve the 500 Internal Server Error problem with these different methods, contact your web host who will be able to debug the problem faster and more efficiently.
It is important to inform your web host of all the steps and techniques that you have tried to try to resolve your problem.
By the way, don’t forget to make a backup before dealing with the problem. It is so easy that you have no excuse not to do it.
Take advantage of the expertise of the professionals at WP hacked help. Our WordPress experts are reliable, competent, and they all have several years of experience in repairing and fixing common wordpress errors and issues. We can quickly fix 500 internal server error on your WordPress site .
If you need to fix http 500 error in WordPress site, we will be happy to provide you with solutions to correct the situation. Get in touch with us without delay to discuss your error to be corrected on your WordPress site.
Мар 15, 2023
Elena B.
7хв. читання
Столкнулись с ошибкой 500 Internal Server Error в WordPress? Ну что же, вы не одни! Ошибка 500 Internal Server Error — одна из самых распространённых ошибок с которой сталкиваются пользователи WordPress. Среди возможных причин появления ошибки: повреждённые файлы .htaccess, неправильно установленные права, задержки скрипта, неправильная версия PHP или неудачное обновление WordPress.
Однако выявить истинную причину не так просто, как, например, в случае ошибки 404, которую могут вызвать либо неработающие постоянные ссылки, либо изменённые URL-адреса страниц.
Вот краткое руководство по исправлению ошибки 500 в WordPress с помощью 9 различных способов. Давайте не будем терять время и начнём данное руководство по WordPress.
Обратите внимание, что Hostinger предлагает специальный оптимизированный для WordPress хостинг. Воспользуйтесь предложением и получите WordPress хостинг со скидкой до 81%!
К предложению
Что вам понадобится
Перед тем, как вы начнёте это руководство, вам понадобится следующее:
- Доступ к панели управления вашим хостингом
- Доступ к панели управления WordPress
ВАЖНО! Безопасность прежде всего. Перед началом данного руководства, мы рекомендуем произвести резервное копирование вашего сайта для предотвращения потери данных.
Способ 1 — Ошибка 500 в WordPress из-за плагинов или тем
В большинстве случаев, ошибка 500 Internal Server Error возникает из-за установки или обновления плагинов или тем. Если вы уже знаете какой из плагинов мог вызвать данную проблему, вы уже на пол пути к её решению.
Способ 1.1 — Ошибка 500 в WordPress из-за обновления или установки плагина
Если страница перестала работать после установки или обновления плагина, вы можете починить её, просто отключив или удалив плагин. В зависимости от ситуации, существует два пути для достижения цели.
Отключение плагинов через панель управления WordPress
Если вы можете войти в вашу панель управления WordPress, следуйте данным этапам:
- Войдите в вашу панель управления WordPress.
- Нажмите на Плагины → Установленные в левом меню навигации.
- Отключите проблемный плагин.
- Обновите сайт в браузере, чтобы проверить решена ли проблема.
- Если нет, отключите другой плагин и повторяйте данный процесс, пока все плагины не будут отключены (или сайт не заработает).
- Как только вы найдёте плагин, ответственный за появление ошибки, попробуйте переустановить его заново. Вы также можете поискать другие плагины на его замену или связаться с разработчиками плагина для уточнения информации о его работе на вашем WordPress.
Отключение плагинов WordPress через Файловый Менеджер или FTP
Существуют ситуации, когда ошибка не позволяет получить доступ к панели управления WordPress. В этом случае, вам придётся отключить или удалить плагин с помощью Файлового Менеджера в панели управления вашим хостингом или FTP-клиентом вроде FileZilla.
- Пройдите в корневой каталог вашего WordPress и войдите в папку wp-content/plugins.
- Найдите проблемный плагин и переименуйте его для отключения. К примеру, вы можете добавить .отключён в конец файла, чтобы не забыть об этом плагине. Если вы хотите удалить его полностью, просто удалите папку с плагином.
- После этого, обновите ваш сайт. В случае, если проблема остаётся, произведите данные действия для оставшихся плагинов до их полного отключения (или пока ваш сайт не заработает).
- Как только вы найдёте сломанный плагин, вы можете попытаться переустановить его, найти замену или связаться с разработчиками плагина для получения консультации.
Способ 1.2 — Ошибка 500 в WordPress из-за установки или обновления темы
Если ваш сайт перестал работать после установки или обновления темы, вы можете решить проблему изменив тему вашего сайта. Для этого существует два пути:
Изменение темы с помощью панели управления WordPress
Если вы можете получить доступ к вашей панели управления, вот что вы должны предпринять:
- Перейдите в раздел Внешний вид → Темы.
- Выберите любую другую тему и нажмите кнопку Активировать.
- Как только вы закончите изменение темы, вы увидите подтверждающее сообщение со ссылкой на ваш сайт.
Изменение темы с помощью phpMyAdmin
Другой способ для изменения темы, это редактирование значений вашей базы данных MySQL через phpMyadmin, в панели управления вашим хостингом. Этот способ может быть полезен, если ваша панель управления WordPress не работает. Вот, что вы должны сделать:
- Найдите таблицу wp_options и откройте её.
ЗАМЕТКА! В зависимости от значений таблицы, выбранных вами в процессе установки, префикс таблиц не всегда будет wp_.
- Перейдите на Страницу 2.
- Найдите раздел template и stylesheet
- Узнайте название темы на которую вы хотите её поменять. Для этого перейдите в каталог wp-content/themes с помощью Файлового Менеджера.
- Скопируйте название темы, которую вы хотели бы использовать. Далее, измените значения template и stylesheet в базе данных на название вашей новой темы. В данном примере, мы изменим тему twentyfifteen на twentysixteen
Теперь вы снова можете перезагрузить ваш сайт в браузере, и он загрузится с новой темой. Если ошибка 500 была связана с вашей старой темой, то это должно решить проблему. Вы можете попытаться переустановить вашу старую тему или связаться с разработчиком для получения информации о правильной установке темы для вашего WordPress.
Способ 2 — Проверка файла .htaccess
Ещё одним способом для избавления от ошибки internal server error, является проверка состояния вашего файла .htaccess. Вероятность того, что ваш нынешний файл .htaccess был повреждён, весьма высока. Это могло случиться из-за огромного количества причин; самые распространённые из них это установка нового плагина или другие изменения на вашем сайте.
Лучшим методом для проверки состояния вашего файла .htaccess является создание нового. Всё, что вам нужно сделать это:
- Войти в панель управления вашим хостингом, далее в Файловый Менеджер в разделе Файлы. Альтернативный способ, это использовать FTP-клиент вроде FileZilla.
- Перейдите в корневой каталог вашего WordPress сайта (если вы видите файлы вроде wp-content и wp-includes, вы в правильном месте).
- Найдите здесь файл .htaccess и отключите его. Это можно сделать задав ему другое имя. К примеру, .htaccess1.
- После этого, создайте новый файл .htaccess и вставьте в него стандартный код .htaccess:
# 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
- Убедитесь, что сохранили файл.
Теперь, откройте ваш сайт в браузере и посмотрите исправлена ли ошибка. Если нет, продолжите чтение руководства.
Способ 3 — Увеличение лимитов PHP
Если два способа описанных выше не принесли никакого результата, то неправильные значения PHP или нехватка памяти могли стать причиной появления ошибки 500. Это происходит из-за того, что скрипты и плагины требуют определённое количество памяти для своей правильной работы. В дополнение к этому, когда загружается ваш сайт, браузер делает огромное количество запросов для загрузки скриптов, плагинов и контента. Когда количество памяти для загрузки скриптов и плагинов не хватает, WordPress, скорее всего, выдаст ошибку 500 Internal Server Error. Именно поэтому, важно увеличить значение памяти вашего сайта и других PHP настроек. Вы можете это сделать с помощью файла .htaccess. Вот несколько строк, которые мы рекомендуем вам добавить:
php_value upload_max_filesize 128M php_value post_max_size 128M php_value max_execution_time 300 php_value max_input_time 300 php_value memory_limit 256M
Не забудьте Сохранить изменения. Теперь, обновите ваш сайт. Если проблема возникала из-за недостаточных лимитов PHP, то этот способ должен помочь с её решением.
Способ 4 — Изменение версии PHP
Некоторые скрипты или плагины для WordPress требуют определённую версию PHP. Если рекомендуемые требования для них не выполнены, то в следствии этого может появиться ошибка 500. Вы можете проверить вызвана ли она версией PHP, изменив её. Это можно сделать через панель управления хостингом в разделе Дополнительно → Выбор PHP версии.
В случае, если вы не знаете какая версия PHP вам необходима, попробуйте поочередно включать каждую из них. Не забудьте Сохранять ваши настройки и обновлять сайт при каждом изменении. Если ни одна из данных версий не помогла в решении ошибки 500, то верните вашу прошлую версию PHP и перейдите к следующем способу.
Способ 5 — Включение отображений ошибок
Поиск причины возникновения ошибки WordPress 500 Internal Server Error — это самая сложная часть в процессе её исправления. Если ни один из предыдущих способов вам не помог, значит вам необходимо начать поиски поглубже — проверив ваши ошибки. Существует несколько способов для этого:
Включение отображение ошибок
Включив отображение ошибок, вы сможете найти определённый код вашего сайта, который её вызывает. Это можно сделать в том же разделе, где мы меняли версию PHP. Дополнительно → Выбор PHP версии. Установите значение Отображать Ошибки на Включена и нажмите кнопку Сохранить.
Теперь, вы должны перезагрузить ваш сайт. Все ошибки кода будет отображены на экране, как на картинке ниже:
Как только вы найдёте ошибку, откройте указанный в ней файл и посмотрите нужную строку. Вы можете использовать Google, Stackoverflow, WordPress Форум, или связаться с вашим разработчиком для получения информации о решении данной проблемы.
Способ 6 — Использование отладки WordPress
WordPress имеет свою собственную систему отладки, которую вы можете использовать для решения проблем с вашим кодом. Это также может помочь решить проблему ошибки 500. Для начала её использования, вам необходимо сделать несколько изменений в вашем файле wp-config.php.
- Найдите следующую строчку в файле wp-config.php:
define('WP_DEBUG', false);
- Удалите и вставьте на её место следующий код:
// 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 );
- Обновите ваш сайт и откройте Файловый Менеджер. Перейдите в каталог wp-content и найдите файл debug.log. Откройте редактирование данного файла для просмотра его значений.
- Теперь вы знаете, что является причиной возникновения ошибки и сможете решить её, обратившись к разработчику или Google, Stackoverflow, WordPress Форуму. Более детальная информации о системе отладки может быть найдена здесь.
Способ 7 — Восстановление резервной копии
Если вы сделали бэкап WordPress до его поломки, восстановление резервное копии тоже может стать решением. Для начала, удалите все файлы WordPress. Затем, загрузите ваш бэкап, перепроверьте, работает ли ваш сайт.
Ручной способ восстановления WordPress может подойти не всем. Если вам кажется это слишком сложным, то мы можем подсказать вам другой способ. К сожалению, это не поможет вам, если ваш сайт не работает, но он точно поможет вам избежать подобных проблем в будущем.
- Установите и активируйте плагин All-in-One WP Migration.
- Найдите его в панели управления вашим WordPress и нажмите кнопку Export.
- Выберите опцию File (Файл), если вы хотите скачать резервную копию на ваш компьютер.
- Скачайте сгенерированную резервную копию на ваш компьютер. Она содержит файлы вашего сайта и базы данных.
- Теперь в случае появления ошибки 500 Internal Server Error (или любой другой проблемы) и невозможности её решения, вы можете просто восстановить ваш сайт с помощью резервной копии.
- Для восстановления сайта с помощью сгенерированной резервной копии, вам необходимо полностью удалить ваш сайт и установить новый WordPress, вместе с плагином All-in-One. После этого, выберите функцию Import (Импорт), выберите сгенерированный бэкап и продолжите процедуру восстановления.
Способ 8 — Переустановка файлов WordPress
Если ошибка ещё появляется, есть кардинальное средство для её решения. Всё, что вам нужно сделать это:
- Скачать последнюю версию WordPress.
- Сохранить и распаковать её на вашем компьютере.
- Удалить файл wp-config-sample.php и папку wp-content для избежания перезаписи важной информации.
- Переместить все корневые файлы на ваш хостинг аккаунт и перезаписать их. Это можно сделать с помощью FTP-клиента FileZilla.
- Далее, должно появиться окно с разрешением на перезапись файлов. Поставьте значения как на изображении для автоматизации процесса.
ЗАМЕТКА! Убедитесь, что вы сделали резервное копирование вашего сайта перед началом данного процесса. Это позволит избежать потери важной информации.
Процесс загрузки может занять от 10 до 20 минут. После завершения, попробуйте вновь обновить ваш сайт в браузере. Если ошибка 500 Internal Server Error была связана с корневыми файлами WordPress, этот способ должен помочь решить проблему.
Способ 9 — Начать всё заново
Если все из приведённых способов вам не помогли, вам придется начать создание вашего сайта с нуля. Хорошей новостью является то, что вы можете восстановить ваш сайт с помощью резервной копии. Загляните в данное руководство для пошаговой инструкции по восстановлению вашего сайта из бэкапа.
Заключение
Все, кто используют WordPress хотя бы раз сталкивались с ошибкой internal server error. Являетесь ли вы продвинутым разработчиком или начинающим пользователем, исправление ошибки 500 является довольно простым процессом, если вы знаете, где искать её причину. Как и в реальной жизни, для решения проблемы нужно сначала найти её источник. После этого, вы можете использовать онлайн ресурсы или это руководство для решения данной проблемы.
У вас есть чем с нами поделиться? Расскажите о ваших идеях или советах в комментариях!
Елена имеет профессиональное техническое образование в области информационных технологий и опыт программирования на разных языках под разные платформы и системы. Более 10 лет посвятила сфере веб, работая с разными CMS, такими как: Drupal, Joomla, Magento и конечно же наиболее популярной в наши дни системой управления контентом – WordPress. Её статьи всегда технически выверены и точны, будь то обзор для WordPress или инструкции по настройке вашего VPS сервера.
Have you encountered an HTTP 500 Internal Server Error on your website? For most webmasters, this can be a frustrating situation.
If you don’t manage to catch the problem early enough, your site’s search engine visibility might take a hit. You might also lose some customers and sustain long-lasting reputational damage.
If spotted and corrected early enough, there may be little to no harm done. The real problem with 500 Internal Server Error is that you often have no clue what the root cause is.
The good news is that It is generally not a serious problem and 500 internal server errors can be easily fixed once you uncover the root cause.
If you follow all the steps we’ll show you in this guide, you will have your website back up and running in no time!
Table Of Contents
- What Does 500 Internal Server Error Mean?
- How to Resolve a 500 Internal Server Error (Without Coding)
- How to Backup Your Website
- How to Fix the 500 Internal Server Error in WordPress Step by Step (Advanced Troubleshooting)
- How to Prevent a 500 Internal Server Error
- Final Thoughts
What Does 500 Internal Server Error Mean?
The 500 Internal Server Error means that the server has been unable to fulfill the request due to an unexpected condition.
As a result, the page will not load and you will see a browser page outlining the error.
Chances are, if it’s down for you, it could be down for your visitors too, making this a vital error to tackle!
When you navigate to a website, you are accessing web files and content that are stored on a remote server. Your browser communicates with this server, requesting the content that you need.
In response, the server sends a HTTP response status code back to your browser, informing it of the status of the request. If successful, the code returned to the browser will be a HTTP code: 200 OK.
The server will then execute the commands, providing a copy of the relevant content to your browser.
If unsuccessful, the server might return one of two classes of codes: a HTTP 400 or 500. Broadly speaking, these aren’t single types of errors, rather, they are classes of errors.
For example, the range of HTTP 500 errors includes codes such as:
- 501 Not Implemented
- 502 Bad Gateway
- 503 Service Unavailable
Each of which indicates a different challenge to address.
How to Resolve a 500 Internal Server Error (Without Coding)
Before you get started with more technical troubleshooting, try these two basic fixes:
- Reload the page to resolve a 500 internal server error
- Clear the cache to troubleshoot a 500 server error
While a 500 Internal Server error can be annoying, it is typically easy to fix.
These errors can sometimes be caused by temporary, minor situations such as issues with your device, network, router or hosting service.
1. Reload the Page to fix HTTP Error 500
500 Internal Server errors can often be resolved with no need for complex troubleshooting.
Sometimes the problem is a temporary situation with your hosting service, ISP or local network. Simply refreshing the web page could be enough to load the site correctly.
If that doesn’t work, perhaps try a forced refresh. This ‘forces’ the browser to request a new page from the server rather than showing you its cached version. This is the best way to assess the current situation with any website.
You can use keyboard shortcuts to force-refresh your web pages. The combinations are slightly different depending on the browser and device you are working in.
Here are the combinations to try.
In Chrome, Firefox, or Edge on a Windows powered device, hold down Ctrl+F5 or Shift+F5 or Ctrl+Shift+R.
If you’re using Chrome or Firefox on a Mac device hold down Shift+Command+R.
2. Clear the Cache to Resolve an HTTP 500 Internal Server Error
Clearing the browser cache is a fundamental part of website troubleshooting. Browser caches help to speed up the browsing experience by storing bits of data from websites you have visited in the past.
Sometimes that cached data can become corrupted and communication between the browser and the website you’re looking at is interrupted. One symptom of this is the 500 error.
Clearing the cache is a straightforward procedure. The steps might differ slightly depending on the browser in use.
Here are the steps to clear your cache in Firefox, Safari, Chrome and Edge:
Firefox
Open up Firefox and click on the menu button.
Select Settings, then on the left hand side panel, select Privacy and Security > Cookies and Site Data and click clear data.
A popup will appear offering the option to check/uncheck Cookies and Site Data, and Cached Web Content.
What you’re after is cached content so tick this box and leave the Cookies and Site Data box unchecked. Click on Clear Data and the cache will be cleared automatically.
Safari
The process is even simpler in Safari.
To clear the cache in Safari click on the Safari menu > Empty Cache > Empty.
Chrome
To clear the cache in Chrome, open the browser and click on the three-dots icon in the topmost right hand corner.
On the dropdown menu, click on more Tools > Clear browsing data.
This will open up a new page where you will be presented with the options of clearing Browsing History, Cookies and Other Site Data, and Cached Images and Files.
Check the box to clear Cached images and files, click on Clear data, and that’s it.
Edge
Open the browser and click on the three-dot menu at the top right hand corner. Navigate to Settings > Privacy & Services.
You will see options for clearing different classes of browsing data. Choose Cached images and files and select Clear now.
Note that the precise steps may vary based on the version of the browser you are using.
If neither of these two simple fixes work, then you’re going to have to apply some more technical troubleshooting methods. Some of these may require making changes to your website or your web server.
Now would be a good time to make a backup.
Troubleshooting can be a risky process and people have been known to completely lose their data.
To avoid this, back up your data safely before you get started. Most hosting providers will keep a backup of your files, but you may not want to rely solely on this.
Read on for a complete step by step-by-step guide on how to back up your WordPress website.
How to Backup Your Website
There are several methods to back up a website. You can do this by installing a plugin, by downloading the files through FTP, or by creating a backup in cPanel.
Each method has its pros and cons and may be more or less suitable depending on your skill level.
Using a Plugin
There are a few plugins you can use to create a backup of your WordPress website. One that we recommend is Updraft.
Log in into the WordPress backend using the wp-admin path. Navigate to Plugins > Add new and search for Updraft.
Install and activate the plugin.
Once activated, a popup will appear, prompting you to ‘Press here to start’. You can also click on Settings under Updraft.
There are quite a few options under Settings which allow you to determine things like backup frequency, which files to include in a backup, how to save your backup, and so on. Set them up as you need.
Once you have made your choices, it’s time to put the plugin to work!
Still on the Updraft Settings page, click on the Backup/restore tab and then on Backup Now.
That’s it! Your website will be backed up.
For more detailed guidance, checkout our step-by-step guide on how to back up your WordPress website.
Backing Up Manually Using FTP/SFTP
File Transfer Protocol (FTP), is the traditional way of uploading and downloading data or content to or from your website. Secure File Transfer Protocol (SFTP) does the same thing but using extra layers of security.
To use this method, you will begin by connecting to your FTP server through an FTP client. The most popular one is Filezilla.
FTP allows for a transfer of files between two computers over a network. In this case, you will be uploading your data from your web server to your computer.
Begin by downloading the Filezilla Client and installing it on your desktop.
Next, you will need to have the FTP server address, along with your username and password. These details are usually provided by your hosting service.
You will then need to set the port to port 21 if you are using FTP, and port 22 if you are using SFTP.
Once your FTP client is all set up, the files and folders that make up your WordPress website will be visible for download.
All you will then have to do is drag and drop them into folders on your computer.
Use cPanel/Ask your Host
Most hosts provide default backup tools in cPanel. If you know your way around cPanel, this is a good option.
Login into cPanel and navigate to Files > Backup Wizard > cPanel Backup > Backup > Full Backup > Download a Full Account Backup > Generate Backup.
How to Fix the 500 Internal Server Error in WordPress Step by Step (Advanced Troubleshooting)
Once you have created a backup of your files, it will be time to turn to serious WordPress troubleshooting.
Here are the steps to follow, along with different methods for troubleshooting an internal 500 error on your WordPress website.
- Turn On Debugging
- Switch Themes
- Deactivate All Plugins
- Check the .htaccess File
- Increase the PHP Memory Limit
- Check File Permissions
- Ask Your Host (Report it to your hosting provider)
- Check the Database Connection
- Reinstall WordPress
Turn On Debugging
Once you’ve gotten your web files safely backed up, it’s time to get into the nitty gritty of resolving the 500 Internal Server Error.
As there could be a wide range of causes for this error message, the first step is to turn on debugging mode.
In debugging mode, WordPress will provide more specific warnings and error messages that help to clarify the cause of the 500 Internal Server Error.
Turning on debugging mode will require a tiny bit of coding. Before you begin, you’ll want to have a fail-safe if things go wrong.
When editing a WordPress core file like the wp-config file, the best practice is to create a backup version.
To do this, first create a copy of the wp-config file.
To find the file, enter cPanel and navigate to Files > File Manager > public_html > wp-config.php.
Next, rename the file by changing its extension. In this case, you would be changing .php to .anything.
Most webmasters like to use .old but it doesn’t matter what you choose.
If things go wrong for any reason, all you have to do is first delete the modified file, then rename the copied file. In this case, that would mean turning your new wp-config.old file back to the default wp-config.php.
Once you have safely created a backup wp-config file, you’ll be ready to turn on debugging mode in WordPress.
Right click on the wp-config folder, to edit it within cPanel.
When the file opens up, scroll to the bottom of the page, where you can add the following line of code:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', TRUE);
Once done, don’t forget to save the change.
Once you’re done debugging, you will need to reverse this. No need to delete the code. Just replace true with false like so:
define('WP_DEBUG', false);
Again, remember to save the change.
Switch Themes
A lot of the time, when things go wrong with a WordPress website, it is down to plugin/theme upgrade issues or compatibility issues. The first step in troubleshooting a 500 internal server error will usually start by changing your theme to one of the default WordPress themes like Twenty Twenty-One.
To do this, navigate over to Appearance > Themes. Click on the theme you would like to install, in this case, Twenty Twenty-One, and activate it.
If the problem persists, you will progress to troubleshooting your plugins.
Deactivate All Plugins
To check if the problem is with your plugins, follow a similar process. In your WordPress backend, navigate to Plugins on the side menu.
Deactivate all plugins and reactivate them one after the other to see which one triggers the problem. Test between each activation to see which plugin causes the 500 error to reappear.
As soon as the error reappears, deactivate the plugin you just activated and test again. If the error disappears, you have found the cause of the error.
If neither changing your theme or plugin resolves the situation, the problem might lie a little deeper under the hood.
Check the .htaccess File
The .htaccess file is a file that controls much of how your users interact with your website. Web servers generally run on two types of software. These are NGINX and Apache, with Apache being the more commonly used.
If your web server runs on Apache, your website will need a .htaccess file that provides instructions to Apache on how access to your site should be granted.
Errors in .htaccess configuration are a common cause of 500 internal server errors.
To check if the error is caused by the .htaccess file, change its name from .htaccess to something else to prevent the server from recognizing and loading it. If this resolves the error message, then you should repair the file or create another.
The .htaccess file can be found in the public_html folder.
To find and edit it, you can either use cPanel or FTP. If you’re using cPanel, you will need to navigate to File Manager > public_html.
Right click on the .htaccess file and select Edit.
Below is what a .htaccess file should look like. If yours is in need of repair, simply paste in this code via FTP/SFTP or access it through the cPanel File Manager.
# 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
If you cannot find a .htaccess file in your public_html folder, you may need to create a new one. This is easy to do.
At the top left-hand corner of your screen, click on + File. In the pop up that appears, enter .htaccess as the New File Name.
Once created, copy and paste in the code above and save the file as .htaccess..
Increase the PHP Memory Limit
When browsers send requests to a web server, some PHP memory is required to execute this process. Sometimes, a 500 Internal Server error occurs because of scripts that use up too much memory before they complete.
To fix this, you can increase the amount of PHP memory available for processing requests while you contact your web hosting service to help with finding and fixing the troublesome scripts.
There are a number of ways to increase PHP memory for a WordPress website as you will see below. By now, you will have learned how to work in these files. All you’ll have to do is add in little bits of code here and there.
Edit the .htaccess file
You’ve already learned how to work with .htaccess earlier. To increase the PHP memory allocation for your website, simply open the .htaccess file in a text editor, and add the following code:
php_value upload_max_filesize 64M
php_value post_max_size 64M
Then save the change.
You can also use 128M or 256M if required. There is no guarantee that this will work as some web hosts limit memory from the server side, which ignores the setting you’re changing. Not all hosts do this, which is why we suggest it here.
Edit the Wp-Config File
You can find the wp-config file for your website in cPanel or using FTP. Download the wp-config file from your root directory, open it in a text editor, and add the following code:
define(‘WP_MEMORY_LIMIT’, ’64M’);
ini_set(‘post_max_size’, ’64M’);
ini_set(‘upload_max_filesize’, ’64M’);
And save the change.
Increase Memory Allocation in PHP.ini
A final method of increasing your WordPress websites’s PHP memory allocation is by increasing the memory allocation from the PHP.ini file. The PHP.ini file is a PHP configuration file that controls things like execution time, memory and much more.
If you’re using shared hosting you won’t be able to edit your PHP.ini file. If you have dedicated hosting or a virtual hosting plan, you might be able to edit your PHP.ini file in cPanel.
Ordinarily, you will find the PHP.ini file stored in your root folder. You can also edit this file manually.
In both cases, first find the PHP.ini file in the root directory of your WordPress installation. As we advised earlier, to create a safety net in case things go wrong, copy a new version of the PHP.ini file and save the old one with a different extension such as .old.
Next, download the file and open it in a text editor. Paste in the configuration values you would like to use on your website–in this case, if you’re trying to set the memory limit at 128 megabytes, you would include a line of code like this:
memory_limit = 128M
If you’re working in cPanel, simply save this file and delete the backup. If you’re working with FTP, upload the file and that should fix the issue.
Check File Permissions
Another possible cause of an internal 500 error is a file permissions error. File permissions determine who can read, write and execute functions within your WordPress code.
Incorrect permissions are a security threat but they can also lead to 500 Internal Server error messages.
If things have gone awry on your WordPress website, check your permissions files to see if the the following WordPress recommended settings are still in place:
- wp-admin: 755
- wp-content: 755
- wp-content/themes: 755
- wp-content/plugins: 755
- wp-content/uploads: 755
- wp-config.php: 644
- .htaccess: 644
- All other files – 644
To check these, you can simply right click on each file in the public_html folder in cPanel or in your FTP client, and click on change permissions.
If the contents of your version of this file look different, update it with these settings. As always, don’t forget to save your changes.
Ask Your Host
If you have tried all the previous steps and nothing has worked, you may need to report the error to your hosting service provider. They will usually be able to accurately troubleshoot any errors, and in many cases, will carry out fixes themselves.
Be sure to provide as many details as you can including what actions you suspect may have triggered the 500 Internal Server Error, as well as the steps you have taken to resolve it.
There are a couple more steps you may take if you would like to complete the troubleshooting process on your own.
Check the Database Connection
An error in establishing a database connection is another potential cause of an internal 500 server error. This can happen for a number of reasons. For example, incorrect database login credentials, a corruption of your WordPress database, or a problem with the server.
A broken database connection will be a little more challenging to resolve as you will not have access to either the front or back end of your WordPress installation.
To resolve this, you will need to access your WordPress files via FTP/SFTP or cPanel.
Next, check the php.ini file to confirm that your database login credentials are correct. As we mentioned earlier, you won’t be able to access this file if you’re using a shared hosting plan. If you are, you may need to ask your hosting service for some help.
If you aren’t, you can find the php.ini file in your cPanel, in the public_html folder.
These credentials include:
- MySQL name
- MySQL database surname
- MySQL database password
- My SQL hostname
You should have these credentials recorded somewhere from when you first set up WordPress.
If these are in order, the problem may lie with a corrupted database.
Fixing a corrupt database is straightforward. Be aware, though, that in rare circumstances, this process can cause you to lose data.
You will have to enable database repair mode by adding a bit of code into the wp-config.php file:
define('WP_ALLOW_REPAIR', true);
You can do this from your cPanel or via FTP.
Navigate to the public_html folder in file manager, right click on the wp_config file and click Edit.
Scroll down to the bottom of the page–right before the line that says “That’s all, stop editing! Happy blogging.”, and paste in the code above.
Once this is done, visit the following address in your browser:
https://yourdomain.com/wp-admin/maint/repair.php
Once here, you will have the options of enabling a WordPress repair, or optimizing the database.
We recommend that you choose the repair option.
Reinstall WordPress
Reinstalling WordPress or reverting to an error-free version of your WordPress installation is a method that will help you get around the problem without really solving it.
If you have gone through all the previous methods without success, you may want to priorities getting your site back online and this method is the quickest way of doing it.
If you opt for this path, then be sure to build your website the right way from the beginning. Properly configured websites are less likely to run into 500 Internal Server errors, at least, not frequently!
How to Prevent a 500 Internal Server Error
There isn’t an exhaustive list of things that could cause a 500 Internal Server error but the following tips should help you avoid the majority of them
These are our top three tips:
Use a Reliable Hosting Service
As you might have realized by now, a lot of what could go wrong with a 500 Internal Server error may happen on your web server, out of your control.
Simply choosing a web hosting provider that provides faster servers and more bandwidth can help. You should also choose a web host that offers responsive and technically skilled customer support.
Use Properly Coded Themes and Plugins
Not all WordPress themes and plugins are built using high-quality code or industry best practices. Astra is, which is why it is so popular with web developers around the world. For a smooth WordPress experience, try Astra!
Use a Staging Environment
Major changes to your website should be tested in a staging environment before being implemented on your live site.
This will allow you to catch any issues with themes of plugins before they have a chance to cause a 500 Internal Server error on your live site.
Final Thoughts
The 500 Internal Server error can cause much distress but now you know what to do when it happens.
Like most technical troubleshooting, it’s largely a case of a process of elimination, trying a fix, testing it and then moving on to another. It’s slow and steady but it works!
Remember to create regular backups of your WordPress website and don’t wait for issues to crop up before you do!
With the steps we’ve shown you, you will overcome any instances of this frustrating error like a pro.
Recommended Articles:
- How to fix the err connection refused error
If you have had to deal with a 500 Internal Server error in the past, let us know which of these solutions worked for you. We’d love to hear what tips you might have!
Join 1,587,020 Subscribers
Get exclusive access to new tips, articles, guides, updates, and more.
Disclosure: This blog may contain affiliate links. If you make a purchase through one of these links, we may receive a small commission. Read disclosure. Rest assured that we only recommend products that we have personally used and believe will add value to our readers. Thanks for your support!