What is a 500 internal server error, and how do i fix it?

      27
The “HTTP 500 Internal Server” error is quite general as it can be caused by a broad range of issues. Because of that, you may stumble upon it quite often.

Bạn đang xem: What is a 500 internal server error, and how do i fix it?

This article will explain the “HTTP Error 500” và how khổng lồ troubleshoot it.

What does “HTTP 500 Internal server Error” mean?

The HTTP status code “500 – Internal vps Error” is one of the many 5.X.X. HTTP error codes (500, 502, 503, 504, etc.). Each of them specifies a different problem but the common denominator they tóm tắt is that they tell you something is wrong with the website’s server.

The HTTP 500 error, in particular, indicates that the server encountered an unexpected condition that prevented it from fulfilling the request.

In other words, the hosting vps can’t determine the exact problem và display a more specific message. Instead, it responds with the error “500 Internal server Error” which means that it’s not clear what’s wrong.

You may see different message variations since many websites & web servers customize the error page.

Some examples of the error message include:

500 Internal vps ErrorInternal server Error 500HTTP Error 500HTTP Status 500 – Internal vps ErrorError 500 Internal hệ thống Error500 Error500. That’s an error

Apart from the text, the page’s look may vary for different websites. Below you can see a generic version of the “Internal server Error” page.

*

Other times, the page may have a customized design, as seen in the following image.

*

These are only a few examples of the error page và you can see it in countless variations. Regardless of how the page looks, it always has the same meaning – there is a problem that the hệ thống can’t pinpoint, and it prevents you from loading the website.

What are the common problems that can cause HTTP 500 Internal vps Error?

Although the error definition states the issue is from the server, that’s not always the case. Some of the common problems that can cause the error are:

Corrupted browser cacheTemporary connectivity issuesSyntax errors or incorrect rules in the website’s .htaccess fileIncorrect file and folder permissionsWrong PHP version for the websiteCorrupted .htaccess fileCorrupted website’s databaseProblems with WordPress themes and pluginsExhausted PHP memory limit on the websiteCorrupted WordPress vi xử lý core filesLarge files on your websiteProblems with the MySQL server

How lớn Fix the “500 Internal Server” Error?

As you can see from the danh sách above, the error’s origins are quite diverse. Since the error page will not clearly indicate the problem, you may need lớn troubleshoot a few of the possible causes until you find the culprit.

We will go over most of the eventual problems and their solutions.

How lớn Fix the “HTTP Error 500” as a visitor?

As a visitor, the only thing you can vày is kiểm tra if a connectivity issue from your over causes the error. You can also apply the following actions as a trang web owner since these are the quickest checks. If the error is caused by a local problem from your end, the steps below can save you a lot of time from troubleshooting.

Reload the page

The “HTTP Error 500” may be visible only for you, in case there was a brief connectivity problem. The trang web itself may be working fine, but you might have tried to access it when there was a momentary downtime, or your network failed lớn establish a connection to the website’s server.

Try reloading the page in the same browser with the Reload button or by pressing the keyboard shortcut Command+R for Mac, or F5 (Control+F5) for Windows.

If the trang web loads correctly, the issue was only temporary, và you can stop troubleshooting.

Clear your browser cache and cookies

When the trang web doesn’t xuất hiện after reloading, your browser might be keeping expired or corrupted cache files and cookies. Reloading the page will not delete them, so you must clear them manually.

Read this guide on clearing cache và cookies in desktop browsers for detailed instructions.

Check these articles on deleting the cache on an android phone or iPhone, if you use a di động device.

Alternatively, you can test opening the page from another browser. For instance, if you use Chrome, try Firefox or vice versa.

After clearing the browser’s cache, reload the page to lớn see if that solved the problem. If not, proceed with the next step.

Visit the trang web using another network

The connectivity problems causing the “HTTP 500 Error” may happen across your entire network. In this case, you will probably see the error on any device on this network.

To test if this is the problem, switch lớn another network. For instance, if you use a smartphone phone connected lớn Wi-Fi, switch to thiết bị di động data.

How lớn Fix the HTTP 500 Internal server Error from the website?

In the best-case scenario, the steps mentioned above will fix the problem. However, if the error persists, you may need khổng lồ dig deeper into the issue since the error stems from the website itself.

As a site owner or webmaster, there are several checks you can bởi vì that can solve the “500 Internal hệ thống Error.”

Check the Error Logs of the Website

In many cases, misconfigured files or scripts are the sources of the website’s errors. The error logs can help you identify them easier.

Typically, you should have such logs in your hosting’s control panel. thietkewebhcm.com.vn users can find the Error log in the website’s Site Tools.

To access it, navigate to the Websites section in your Client Area. Open the Site Tools of the respective site, select Statistics & click on Error Log.

You will see the most recent errors on your website that the server detected. Each error will be recorded with a few key pieces of information:

The date and time of the error.Description of the error.Information about which thư mục or tệp tin is possibly generating the error.

Below, you can see an error log indicating a problem with the .htaccess file.

*

This record indicates that the problem is from the .htaccess tệp tin located in the root folder of the website. It also specifies that the error is related to lớn an missing arguments, which means there is a syntax error.

Using this information, you can navigate to lớn the specified folder from File Manager, edit the .htaccess file và correct the syntax error.

Keep in mind that the Error log records errors related khổng lồ the server configuration. Errors caused by PHP misconfiguration & scripts are not recorded, as they happen on application-level.

PHP errors are recorded in php_errorlog. It is generated automatically in the thư mục of the offending PHP file. On thietkewebhcm.com.vn’s hosting, the PHP error log is active by default. If you have previously deactivated it or your hosting hasn’t enabled it, read this guide on how to enable error reporting in a PHP script.

To inspect the PHP error log, you can use file Manager or FTP client. Navigate to lớn the root folder, if the error is caused by a script located in the root folder. Xuất hiện the file php_errorlog, where you can examine the errors.

The php_errorlog shows general PHP errors. However, you may need a more detailed log of the problem. If you have a WordPress website, you can also enable the debug log for WordPress that can show more information. For detailed steps on how to lớn enable the WordPress debug log, see this guide.

Reset file and folder Permissions

Another common problem that can cause the “HTTP 500 Error” are incorrect tệp tin and folder permissions on your website. If the permissions prevent visitors from opening the critical website’s files & folders, they may see the error page.

The standard permissions are 644 for files and 755 for folders. You can change them from the File Manager in your hosting panel or from an FTP Client.

For setting the permissions for WordPress sites, thietkewebhcm.com.vn clients can use the Reset Permissions tool for WordPress in Site Tools.

If your website is using another type of application, read this guide on how to lớn change permissions for files and folders from file Manager.

Alternatively, if your hosting’s panel doesn’t have similar tools, you can change permissions from SSH or from an FTP Client.

Change the PHP version

An incorrect PHP version on your trang web may cause PHP scripts lớn time out or produce fatal errors. As a result, the website may return the “HTTP 500 Error.”

Test switching the PHP version lớn an older or later version. If the error disappears, it’s an indication that the previous version was wrong. Keep the site on the newly selected one.

thietkewebhcm.com.vn users can easily switch the PHP version with only a few clicks on Site Tools. For detailed steps, kiểm tra this guide on how khổng lồ switch khổng lồ a different PHP version in Site Tools.

Inspect or regenerate the .htaccess file

A common cause of the “Internal vps Error” is a problem within the .htaccess file. If the file is corrupted, it defines an incorrect root thư mục or contains syntax errors, the usual result is the “HTTP 500 Error” page.

Xem thêm: 7 Cách Tăng, Giảm, Chỉnh Độ Sáng Man Hình Laptop Cực Kỳ Đơn Giản

Fix the syntax error in .htaccess

As an example of a syntax error, we can use the previously mentioned error from the error log.

directive requires additional argumentsTo inspect the file, open the Site Tools of the website. Then, select the section Site and xuất hiện File Manager.

Navigate to the website’s root folder, which is the site name/public_html. In our example, the name is sg-testing.com, so the folder path is sg-testing.com/public_html.

In this folder, you can find the .htaccess file. Select the file và then press Edit to xuất hiện the code editor.

*

Now, you can inspect its code. As the error log points, the problem is from the . The issue is a syntax error because the module is missing a forward slash in the closing tag .

*

Add the slash and then save the changes with the Save button. Reload the website và it should now load properly.

*
Wrong website’s root folder defined in .htaccess

Another common error in .htaccess is incorrectly defined root folder for the website. Usually, this is a result from one of the following cases:

You transferred the trang web from another hosting provider where it resided on a subfolder.You developed the website on a subfolder và then moved it to the main domain folder in the same hosting.For a WordPress website, you installed a plugin that has changed the RewriteBase in .htaccess. The plugin may need extra configuration to work with the modified code but currently, the website is inaccessible due to lớn the “500 Internal Error”.

To illustrate the problem better, we can use the following example.

*

Notice the /dev path in RewriteBase. This code instructs the hệ thống to load the trang web from a thư mục named public_html/dev. Since the folder is non-existent, when you load a page from the website, it will produce the “Internal hệ thống Error” screen.

To fix the problem, simply remove the subfolder path from RewriteBase so the code would look lượt thích this:

# BEGIN WordPressRewriteEngine OnRewriteBase /RewriteRule ^index.php$ - RewriteCond %REQUEST_URI !/(wp-content/uploads/.*)$RewriteCond %REQUEST_FILENAME !-fRewriteCond %REQUEST_FILENAME !-dRewriteRule . /index.php # over WordPressThis is the mặc định WordPress code defining the root folder for the website. Confirm the change in File Manager with the Save button & reload the website. The error shouldn’t appear anymore.

Regenerate the .htaccess file

Another standard troubleshooting scenario is lớn replace the .htaccess tệp tin with a new copy. Lớn replace the tệp tin with a new copy, xuất hiện File Manager, navigate to public_html, select the file .htaccess & choose Rename.

You can choose any name for the file. For example, you can name it htaccess-old and create a new .htaccess file.

*

If the trang web is WordPress, access the WordPress dashboard, navigate lớn the section Settings, and mở cửa Permalinks. Just click on the button Save Changes, and your website will generate a new .htaccess file with the default WordPress code.

*

If your trang web is not WordPress, find the mặc định .htaccess code for your specific application. Use the button New tệp tin in File manager và name the new file .htaccess. Paste the mặc định code into .htaccess and save the changes.

*

After the new .htaccess file is set, reload the website again khổng lồ see if the error is gone.

Repair the database or fix the database credentials

Another common problem that can cause the “500 Internal vps Error” is a corrupted database of your website. You may consider restoring the database from a backup or repairing it.

For WordPress, the error may occur if the trang web fails to lớn connect to lớn the database. Make sure that the credentials are set correctly in the wp-config.php file.

For detailed steps, read this guide on how khổng lồ fix the error ‘Establishing a Database Connection’ in WordPress.

Disable plugins for your WordPress website

A misconfigured plugin can also trigger the “HTTP 500 Error” in WordPress. The standard procedure is lớn disable the plugins one by one until you find the culprit.

If the error is only on the front-end, but you still have access to lớn the WordPress admin dashboard, you can disable the plugins from the section Plugins. Then choose Installed plugins. From the drop-down Bulk actions menu, select Deactivate. Kiểm tra the box Plugin and press Apply to deactivate all plugins.

*

In many cases, the error prevents you from logging into the WordPress dashboard so you may need khổng lồ use an alternative way.

A popular suggestion you’ll find online is to rename the wp-content/plugins folder. We don’t recommend this method as it may fix the “HTTP 500 Error”, but cause other complications.

It is safer and more efficient to lớn disable all plugins from Site Tools (if you are a thietkewebhcm.com.vn user) or from the database.

Read the following guides for detailed steps:

After the plugins are disabled, reload the website. If the website is fixed, it is a strong indication that the error is caused by one of the plugins.

Proceed by activating the plugins one by one. When the faulty plugin is reactivated, the error will return. You can then disable the plugins again to access the dashboard & activate all plugins apart from the problematic one.

You may consider replacing this plugin with another one or contacting its developers to lớn report the problem.

Change the theme for your WordPress website

A badly configured theme can also cause the “500 Internal hệ thống Error” in WordPress. To kiểm tra if the theme is the problem, you will need to lớn replace it with another one.

Usually, you can change the theme from the website’s WordPress dashboard. However, in many cases, the ongoing “HTTP 500 Error” prevents you from logging in.

Read this guide on how to change the WordPress theme from the database for more information.

Increase the PHP Memory Limit of the Website

The “HTTP 500 Error” may also be caused by PHP scripts that exceeded the memory limit of your website. By mặc định the limit on all thietkewebhcm.com.vn plans is set to lớn 512M. However, your WordPress trang web may be set to lớn a lower value. To lớn increase the memory limit, follow the steps from this guide on how lớn increase WP Memory Limit.

Restore a Backup of the Website

If none of the solutions helped solve the issue or you find them challenging to implement, you may consider restoring the trang web from a backup. Restoring the website will revert all changes that caused the error in the first place.

thietkewebhcm.com.vn users can kiểm tra this detailed tutorial for the website Backup Tool.

Check if your trang web contains large files

Another common reason for this error is having a very large file as a part of your website. On thietkewebhcm.com.vn’s shared hosting servers there is a kích thước limit for files that can be opened through the web. The limit is 8GB, và if your trang web includes a larger file, this will result in the above error.

Check your website’s files either via SSH, FTP, or tệp tin Manager khổng lồ locate the one causing the problem. Very often, these are logs with PHP errors.

On thietkewebhcm.com.vn’s servers, a log file is created automatically if your site’s PHP scripts produce any non-critical errors or warnings during their execution. The log file’s name is php_errorlog, và it is located in the same directory as the script that produced the errors. Usually, this would be your website’s root folder.

Contact the website hosting provider

Ultimately, the “500 Internal hệ thống Error” may not be caused by your trang web configuration. The MySQL hệ thống may be down, or the server may be overloaded. Liên hệ your website hosting’s support team so they can kiểm tra the server’s status & help further with the problem.

Summary

The HTTP “500 Internal server Error” can be very frustrating to khuyến mãi with because of its unclear nature. The problem may originate from a local issue or an error on the trang web or the server.

This guide can help you narrow down the causes lớn fix the error more efficiently.

The “HTTP 500 Error” is one of the many error codes. Read this guide khổng lồ find out more about the different error codes.

For more information about fixing other 5.X.X. Status codes, read the following articles:

hotlive