How to fix 500 internal server error: 8 solutions – Copahost

Error 500 – Internal Server Error is a very common problem on web servers. It can be caused by several reasons. In this article, we will explore the possible causes and present alternatives on how to fix internal server error 500. This error is similar to 404.

<img src="https://www.copahost.com/blog/wp-content/uploads/2019/02/http-error-500-how-to-fix1.jpg" alt=

“How to Fix Internal Server Error 500” />

Article Contents

: 1.0

The Causes of Error 5002.0 How to Fix Internal Server Error 500 on WordPress Sites

2.1 Solution 1: Reset the .

htaccess via WordPress2.2 Solution 2: Manually reset the .htacess2.3 file Solution 3: Update and disable add-ons2.4 Solution 4: Try changing your theme

3.0 How to Fix

Error 500 on Non-Wordpress Sites 3.1 Solution

5 – Check Your .htaccess Syntax3.2 Solution 6: Rename Your .htaccess3.3 File Solution 7: enable the error displayed in php3.4 Solution 8: Check the error logs 4.0

Conclusion

The causes of HTTP error 500

Every time a web server delivers a web page to the client, it throws HTTP status codes. Each status code signifies the result of that request. For example, HTTP status 200 stands for success: when a page was delivered and displayed successfully.

For example, status code 404 means that the error page was not found. So, HTTP error 500 means an internal server error message. Such a 500 error is one of the most widespread HTTP errors and can have several possible causes. In this article, we will address the most common causes. And, of course, show the solutions for them.

This specific error is most commonly caused by server-side issues. Even a single PHP script syntax error, file permissions, or htaccess misconfiguration can cause such an error. This error does not depend on the operating system: Windows and Linux-based web servers will present such HTTP status code. Even external resources can cause error 500.

How to Fix

Internal Server Error 500 on WordPress Sites Most of the issues

that generate server error 500 in WordPress are caused by issues in the .htaccess file. Some of the problems are caused by plugins or templates. To fix this issue, we’ll first reset the .htaccess file. Then, if it persists, we’ll look at an issue with plugins or templates.

The .htaccess file is a

common file that defines redirects and behaviors on the web server. cPanel has a default .htaccess file, which is placed inside the root folder of your WordPress blog. For example, our blog is in the root folder of the website. Therefore, the .htaccess file is located within public_html.

http error 500 how to

Most of the 500 error issues in WordPress are caused by plugins or incorrect settings in the .htaccess file. We suggest resetting this file.

There are two methods

:

Solution 1: Reset the .htaccess via WordPress admin panel

First of all, open the Permalinks section. It is located in Settings.

Whenever you make changes to your permalink structure, WordPress automatically resets the .htaccess file. Keep in mind that resetting these settings can affect your SEO. Now, we recommend changing the option on this screen. After that, click Save. This way, WordPress will reset your .htaccess file and error 500 can be resolved.

http error 500 how to

Solution 2: Manually reset the

.htaccess file

If you use WordPress, you may want to reset your .htaccess to defaults. Make sure to copy and keep a backup of your old/current .htacess file.

This is what the default WordPress .htaccess file looks like. Just empty the .htaccess and. Then, copy and paste this content into your .htaccess:

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

Solution 3: Troubleshoot plugins To

help our customers on how to fix the internal server error 500, we have to troubleshoot and try to find the cause of the problem. It is very common to have plugins or templates that generate this problem.

First of all, click on the Installed Add-ons option. It is located in Plugins.

Then, you should try to update each plugin with such a message. To upgrade, simply click Update Now. If after updating each plugin, you still have the internal server error 500, we recommend disabling the plugins one by one until you find the problematic one. Just click Disable.

http error 500 how to

Solution 4: Change the theme

Sometimes a change was applied to the theme, and some PHP files may be corrupted. To fix server error 500, there is another possibility: change the WordPress theme. To do that, simply go to Themes in the Appearance menu.

http error 500 how to

Then find a different topic and click Activate. <img src

=”

https://www.copahost.com/blog/wp-content/uploads/2019/02/http-error-500-how-to-fix8.jpg” alt=”” />

How to fix this error on sites

Non-Wordpress There is a strong possibility of causes of error 500 on sites that do not use WordPress. In this section, we will show the most common causes and solutions on how to fix the problem of internal server error 500. Most of the time, this problem is caused by problems in your .htaccess file. This file is always located in the root (public_html) folder.

http error 500 how to

Solution 6: Check the syntax of the

.

htaccess file Just edit this .htaccess file and look for any incorrect settings. We recommend this .htaccess tester. This way, you can copy and paste the contents of your current .htaccess file. This site shows which lines have incorrect syntax. It will highlight in red all the problematic lines, so you can fix them. http error 500 how to

Solution 7: Rename

the .htaccess file You

can simply rename this file. It will disable it on the server. Just change its name to something like . Htacess-old, for example. This way, you can see your site’s behavior without it.

Solution 8: Enable the error shown in

PHP

By default, PHP displays all 500 errors this way. There is an option that you can enable, to force PHP to display on the screen the exact error message. <img src=”https://www.copahost.com/blog/wp-content/uploads/2019/02/http-error-500-how-to-fix11.jpg” alt=”” /> Simply add these lines to the beginning of your PHP file, inside the <?php and ?> tags.

error_reporting E_ALL); ini_set(‘display_errors’, ‘activated’);

You can now see the exact error message to fix the 500 internal

server error issue:

http error 500 how to

Solution 9: Check the

error logs on the server

Finally, if none of the above solutions worked, we recommend checking the error logs. They will probably show you the reason for the internal server error 500. In your cPanel dashboard, open the Errors option, found under Metrics.

http error 500 how to

Then, all error messages will be displayed

.

Conclusion

Internal Server Error 500 is one of the most widespread problems in web hosting. There are several possibilities and causes for that. We have helped many hosting customers on how to fix the 500 internal server error issue so far. As we explained, there are easy and quick solutions and the most difficult ones.

The last possibility is to check the log files if none of the solutions worked for you. Then, after checking the error logs, you can simply Google the exact error message. Surely there will be pages that show their corrections. At least, but not last, you might want to check out this other article on how to use custom error pages on your site.

Contact US