WHY AM I GETTING A 500 INTERNAL SERVER ERROR MESSAGE?

  -  

500 internal vps error clearly indicates that something went wrong during the display of PHP page.

Bạn đang xem: Why am i getting a 500 internal server error message?

By default, web servers like IIS return only generic error messages in websites. Often, this causes the masking of real reason for IIS PHP errors such as 500 internal vps error.

That’s why, we frequently get request from Windows server owners lớn find out the reason for PHP website errors & fix them as part of our server Management Services.

Today, we’ll take a look on how hostingvietnam.vn’ Engineers track the real reason and fix php 500 internal hệ thống error in IIS.

What causes PHP 500 internal server error in IIS

Basically, 500 Internal vps Error is IIS web server’s way of saying, “Something has gone wrong when I tried lớn display the page. Not sure what.

Now, its time khổng lồ see the exact reasons for the 500 errors.

1. Permissions Error

From our experience in managing servers, our Windows Experts often see PHP 500 internal server errors due lớn wrong permissions & ownership on website files. In Windows servers, every file và every folder has its own mix of permissions. Again, some permissions are inherited from the parent folders too. And, when the PHP binary vì not have enough permissions khổng lồ execute the scripts, it can result in 500 internal hệ thống error.

Similarly, ownership of the files also create problems. In Windows, specific users like IIS User, IIS WP User, etc. Should have access on the website folders và files. For example, the IUSR trương mục should have modify permissions on php scripts. And, when there are permission problems, trang web shows PHP errors.

2. Bad PHP Settings

Yet another reason for PHP internal vps error is bad PHP settings. The PHP settings are specified in the configuration tệp tin at C:PHPPHP.ini. PHP binary take the values from this file while executing scripts.

A classic example will be PHP timeout settings. When the trang web PHP scripts has khổng lồ fetch results from external resources, PHP timeout values often cause trouble. Most system administrators phối timeout values in PHP lớn avoid abuse of the server resources. And, if the PHP script executes for a time longer than the threshold limits, it eventually results in 500 error.

3. PHP module errors

A very few 500 errors happen when the PHP module on the hệ thống as such becomes corrupt too. As a result, it results in processing failure of PHP scripts.

Xem thêm: Chia Sẻ Cách Nén Video Không Cần Phần Mềm Chuyên Dụng, Cách Nén Dung Lượng Video Không Cần Phần Mềm

Luckily, when the website reports the 500 error due khổng lồ module failures, IIS often show a more specific error messages like:

500.0 Module or ISAPI error occurred.500.21 Module not recognized.

How we fixed PHP 500 internal vps error in IIS

Fixing PHP 500 internal server error in IIS need a series of steps. Let’s now see how our Dedicated Engineers fixed it for one of our customers và made PHP scripts running.

The customer reported 500 internal vps error on WordPress trang web running in IIS.

1. Turning On Display errors

While the error correctly suggested that PHP had caused 500 error code, it did not provide application-specific information about what caused the error. Therefore, the the first step of investigation was khổng lồ turn ON display errors option. For this, our Dedicated Engineers followed the steps below.

After turning on the errors, we reloaded the PHP and it showed a PHP parse error:

Parse error: parse error in C:inetpubusersxxxhttpdocsmysiteerror.php on line 3 >> Often browser settings only show friendly error messages. In such cases, we recommend customer to lớn turn it Off. For example, in internet Explorer Go to lớn Tools, mạng internet Options, Advanced tab, & then clear the Show friendly HTTP error messages kiểm tra box.

Thus, it was a coding error on the PHP script. We suggested script modifications lớn customer & that fixed the error.

2. Running PHP script locally

Yet another way khổng lồ find the exact error is khổng lồ run the problem php script within the server. For this, our support Engineers connect lớn the hệ thống via rdesktop và execute php script using the php.exe binary. It would show the DLL’s that are having conflicts and causing the 500 error. We fix these conflicts và make the script working again.

3. Correcting PHP settings

In some cases, we need to lớn correct the PHP settings to lớn get the problem solved. Recently, when a customer reported problems with his website, we had lớn set the php directive open_basedir correctly khổng lồ solve 500 Internal server Error.

Similarly, when PHP cgi scripts show up some warning, IIS7 still displays an HTTP 500 error message. Although the best method is to lớn fix the PHP scripts, often changing the default error handling for FastCGI in IIS7 khổng lồ “IgnoreAndReturn200” also work as a temporary fix. The exact settings will look as shown.

*

4. Fixing PHP binary

In some rare cases, the fix may involve complete rebuilding of PHP binary on the server. This happens mainly when the PHP program on the vps becomes corrupt. However, in such cases our Dedicated Engineers always kiểm tra the dependency of the package và do the reinstall. For control panel specific servers, we phối the appropriate binary on the server.

Xem thêm: Cách Kiểm Tra Thông Tin Website Bằng Whois, Whois Domain

Conclusion

In a nutshell, PHP 500 internal server error in IIS happens mainly due to reasons lượt thích buggy PHP scripts, wrong hệ thống settings & many more. Today, we saw the đứng đầu reasons for the error and how our support Engineers fix it for customers.