500 internal server error clearly indicates that something went wrong during the display of PHP page.
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 server error.
That’s why, we frequently get request from Windows server owners to find out the reason for PHP website errors and fix them as part of our Server Management Services.
Today, we’ll take a look on how Bobcares’ Engineers track the real reason and fix php 500 internal server error in IIS.
What causes PHP 500 internal server error in IIS
Basically, 500 Internal Server Error is IIS web server’s way of saying, “Something has gone wrong when I tried to display the page. Not sure what.”
Now, its time to 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 to wrong permissions and ownership on website files. In Windows servers, every file and every folder has its own set of permissions. Again, some permissions are inherited from the parent folders too. And, when the PHP binary do not have enough permissions to execute the scripts, it can result in 500 internal server 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 and files. For example, the IUSR account should have modify permissions on php scripts. And, when there are permission problems, website shows PHP errors.
2. Bad PHP Settings
Yet another reason for PHP internal server error is bad PHP settings. The PHP settings are specified in the configuration file at C:\PHP\PHP.ini. PHP binary take the values from this file while executing scripts.
A classic example will be PHP timeout settings. When the website PHP scripts has to fetch results from external resources, PHP timeout values often cause trouble. Most system administrators set timeout values in PHP to 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 server as such becomes corrupt too. As a result, it results in processing failure of PHP scripts.
Luckily, when the website reports the 500 error due to 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 server 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 and made PHP scripts running.
The customer reported 500 internal server error on WordPress website 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 to turn ON display errors option. For this, our Dedicated Engineers followed the steps below.
- Using Windows® Explorer, browse to C:\PHP and open the Php.ini file in the PHP installation directory.
- Edit and set the display_errors = On directive.
- Save the file.
- Reset IIS using the command iisreset.exe
After turning on the errors, we reloaded the PHP and it showed a PHP parse error:
Parse error: parse error in C:\inetpub\users\xxx\httpdocs\mysite\error.php on line 3 >>
Often browser settings only show friendly error messages. In such cases, we recommend customer to turn it Off. For example, in Internet Explorer Go to Tools, Internet Options, Advanced tab, and then clear the Show friendly HTTP error messages check box.
Thus, it was a coding error on the PHP script. We suggested script modifications to customer and that fixed the error.
2. Running PHP script locally
Yet another way to find the exact error is to run the problem php script within the server. For this, our Support Engineers connect to the server via rdesktop and 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 and make the script working again.
3. Correcting PHP settings
In some cases, we need to correct the PHP settings to get the problem solved. Recently, when a customer reported problems with his website, we had to set the php directive open_basedir correctly to 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 fix the PHP scripts, often changing the default error handling for FastCGI in IIS7 to “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 server becomes corrupt. However, in such cases our Dedicated Engineers always check the dependency of the package and do the reinstall. For control panel specific servers, we set the appropriate binary on the server.
[Broken PHP scripts causing big problems? Our IIS experts have the fix for you.]
Conclusion
In a nutshell, PHP 500 internal server error in IIS happens mainly due to reasons like buggy PHP scripts, wrong server settings and many more. Today, we saw the top reasons for the error and how our Support Engineers fix it for customers.
PREVENT YOUR SERVER FROM CRASHING!
Never again lose customers to poor server speed! Let us help you.
Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.
GET STARTED
var google_conversion_label = «owonCMyG5nEQ0aD71QM»;
Recently my ISP switched our website to an IIS7.0 high availibility cluster. The website is running on PHP5.2.1 and I can only upload files (so no registry tweaks). I had tested the website before and everything seemed to be working, but now the checkout page fails with:
500 — Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.
As error messages go, this isn’t very informative. I’ve tried:
ini_set('display_errors', 1);
ini_set('error_log', $file_php_can_write_to );
but both don’t seem to do anything.
Anyone know how to get better debugging output?
Charles
51k13 gold badges105 silver badges142 bronze badges
asked Nov 8, 2009 at 15:29
Edit : Looks like we have a similar question in serverfault. Check it out
Turning off IIS7 custom errors will allow error responses from your application to be sent to remote clients without being censored by the IIS7’s custom errors module.
You can do this from the IIS7 Admin tool by running “Start>Run>inetmgr.exe”, selecting your website/application/virtual directory in the left-hand tree view, clicking on the “Error Pages” icon, clicking “Edit Feature Settings” action, and then selecting “Detailed Errors”
Source
answered Nov 8, 2009 at 15:34
ShobanShoban
22.9k8 gold badges64 silver badges107 bronze badges
5
It’s very common when you change server you cannot load your apps. I have solved this problem running php.exe
instead of loading your apps on the browser:
1) Run it using the Command line > C:\php\php.exe
OR
2) Run Windows Explorer
, look for it, and double click on c:\php\php.exe
.
3) You are gonna see what DLL’s are having conflicts and causing the 500 error.
4) Solve the conflicts finding the right DLL’s for your windows version and you should be able to see your apps through the browser.
The best of the lucks.
answered Jan 16, 2016 at 23:11
RGARGA
1471 silver badge6 bronze badges
IIS does this, it’s really annoying and I could not find a fix, which is what caused me to switch to an Apache server for my local machine. Unfortunately, if you don’t have control over your server, the best you can do is either test it locally on an apache set up or ask your host to allow the error messages.
I did some googling, thisthis looks like what you need. Wish that was around when I was trying to get IIS running.
answered Nov 8, 2009 at 17:00
Chris SobolewskiChris Sobolewski
12.8k12 gold badges63 silver badges96 bronze badges
2
If your Internet Information Services (IIS) produces a 500 – Internal server error, your website is in serious trouble. Debugging an IIS 500 – Internal server error can take some time, so you’d better be prepared for the worst-case scenario. You don’t want to research how to deal with this error under time pressure.
Contents
- Cause of 500 – Internal server error
- Debugging an IIS 500 – Internal server error
- Resolving an IIS 500 – Internal server error
- Common 500.x substatus codes
- Author
- Recent Posts
Surender Kumar has more than twelve years of experience in server and network administration. His fields of interest are Windows servers, Active directory, PowerShell, web servers, networking, Linux, virtualization, and Kubernetes. He loves writing for his blog.
Latest posts by Surender Kumar (see all)
- Kubernetes DaemonSets — Wed, Sep 6 2023
- Static Pods in Kubernetes — Fri, Sep 1 2023
- Encrypt Kubernetes Secrets at rest — Mon, Aug 28 2023
In my previous posts, you learned about detailed errors and failed request tracing in IIS (Internet Information Server). I recommend reading those articles first before you proceed with this one.
Cause of 500 – Internal server error
This is the most common error you will encounter with any website hosted with IIS. In most cases, a developer messed up. Thus, the fastest way is often to simply reverse the last action taken, such as restoring an earlier version of your web application. Once your system is running again, you can investigate the cause of the error on your test side in peace.
500 Internal server error
The HTTP 500 error is a server-side error. While we understand that the problem is on the server end, the error is usually ambiguous. It doesn’t exactly tell the administrator what is wrong with the server. Thus, debugging a 500 – Internal server error often takes some time.
Debugging an IIS 500 – Internal server error
Since the above error doesn’t really tell what’s actually wrong with the server, we need to enable detailed errors, as discussed in my previous post. Once detailed errors are enabled, you will see more detailed error information, including an HTTP substatus code. Sometimes even the detailed errors don’t show any useful information right away. For example, see the following screenshot:
The page cannot be displayed because an internal server error has occurred
Here I am getting: The page cannot be displayed because an internal server error has occurred. There is no HTTP status code or substatus code listed on the error page. If you get such an error even when detailed errors are enabled, right-click anywhere in the browser window and select Inspect (or press F12).
Opening developer tools in web browser to reveal server errors
This opens the developer tools in your browser window. Now, click the Console tab. The actual error thrown by the web server is displayed.
Viewing server errors using the Console tab of the web browser’s developer tools
To further understand the exact cause of 500 errors, enable Failed Request Tracing, as discussed in my previous post. Now, try to replicate the problem. If you can replicate it, open the newly generated XML log file in a web browser. The following screenshot shows the actual cause of a 500 – internal server error with a substatus code of 19 (HTTP 500.19 error):
Determining the cause of a 500 error using the Failed Request Tracing log file
Usually, substatus code 19 indicates that the configuration data is invalid. This could be due to some malformed or unidentified element in a server-level config file (ApplicationHost.config) or website-level config file (web.config). If you take a closer look at the ConfigExceptionInfo field of the log file, you will find the exact line number (6 in our case) in the web.config file that caused the exception. Now let’s take a look at the web.config file itself.
Viewing the problematic element in the web.config file
Here, you can see that the developer tried to add a mime type in the config file, but it was already defined in the server-level configuration file (i.e., ApplicationHost.config). Therefore, the Cannot add duplicate collection entry of type ‘mimeMap’ with unique key attribute ‘fileExtension’ set to ‘.mp4’ exception was returned. Furthermore, if there is some unidentified element, a syntax error, or even a typo in the web.config file, you will most likely get a similar error.
Resolving an IIS 500 – Internal server error
To resolve an IIS 500 – Internal server error, you could simply remove the line that is causing the exception. Alternatively, if you don’t want to remove this line for some reason, add the following code right above line 6 in web.config:
<remove fileExtension=".mp4" />
By doing this, you are essentially overriding the server-level element. In the end, your web.config file should look as shown below:
Overriding the server level mime element with web.config file
Now refresh the page, and the error should go away. This was just one example of resolving a 500.19 error. If you get a 500 error with a different substatus code, use the same approach to troubleshoot the problem.
Common 500.x substatus codes
The following table covers some of the most common HTTP 500 substatus codes, along with their probable causes and troubleshooting advice:
Subscribe to 4sysops newsletter!
Status Code | Probable Cause | Troubleshooting Advice |
500.11 | The application is shutting down on the web server | The application pool is shutting down. You can wait for the worker process to finish the shutdown and then try again. |
500.12 | The application is busy restarting on the web server | This is a temporary error and should go away automatically when you refresh the page. If the error persists, something is wrong with the web application itself. |
500.13 | The web server is too busy | This error indicates that the number of incoming concurrent requests exceeded the number that your IIS application can process. This could be caused when the performance settings are not right. To troubleshoot such issues, a memory dump needs to be captured and analyzed using tools such as Debug Diagnostic. |
500.15 | Direct requests for Global.asax file are not allowed | A direct request was made for the Global.asa or Global.asax file, which is not allowed by the web server |
500.19 | The configuration data is invalid | We already covered how to fix this error above |
500.21 | The module not recognized | This status code is caused by a partial installation of the IIS server, such as missing ISAPI modules. To fix this error, identify the missing IIS components and install them. |
Once you troubleshoot the problem, don’t forget to disable Failed Request Tracing and revert the detailed errors to custom errors on your web server.
You might see the below error while you install PHP 7.4 on the windows server with IIS and run any of the PHP pages.
While we run the php-m command in the command prompt, it has given the below warning.
PHP Warning: ‘vcruntime140.dll’ 14.0 is not compatible with this PHP build linked with 14.16 in Unknown on line 0As per the warning we need to upgrade the Visual C++ runtime to the latest version. Here, we will upgrade it to Visual ++ 2015-2019. You need to install it as per your system require whether it is x64 or x86.
As per the warning we need to upgrade the Visual C++ runtime to the latest version. Here, we will upgrade it to Visual ++ 2015- 2019. You need to install it as per your system require whether it is x64 or x86.
Download Visual Studio C++ > Redist.64.exe
Download Visual Studio C++ > Redist.86.exe
You can install it both if you face the issue by installing anyone. 500 Internal error shouldn’t occur again.
Was this answer helpful?
Recommended: Fortect
Download this software and fix your PC in minutes.
This user manual is intended to help you if you get an internal server error 500 php iis. Hypertext Transfer Protocol (HTTP) Server Error Response Policy 500 An internal server error indicates that the server encountered an unexpected severe condition that prevented it from responding to the request. This usually indicates that the server cannot find a better 5xx error code to respond to.
Internal Site Error 500 clearly indicates that something was mistakenly disabled when PHP rendered the site.
By default, web servers such as IIS only return generic error messages that run on web sites. This will often hide the real cause of PHP IIS errors, such as Internal Hosting Error 500.
For this reason, we often get programs from Windows server owners to figure out the cause of PHP URL errors and fix them as part of our server management services task.
Today we’ll see Bobcares engineers investigate the real cause and fix an internal PHP 500 web server error in IIS.
What Causes PHP 500 On Server Error In IIS
Reload our website.Clear your memory cachehis browser.Delete cookies from your browser.Please troubleshoot if you encounter a 504 gateway timeout error instead.However, you can always contact the site directly.Come back later.
Recommended: Fortect
Are you tired of your computer running slowly? Is it riddled with viruses and malware? Fear not, my friend, for Fortect is here to save the day! This powerful tool is designed to diagnose and repair all manner of Windows issues, while also boosting performance, optimizing memory, and keeping your PC running like new. So don’t wait any longer — download Fortect today!
Essentially, the 500 Internal Server Error is how the IIS website server says, “Something went missing when I tried to view the page.” I do not know what “.
Now his time is taken up with precise basic factors We have 500 errors.
1. Authorization Failed
In our server management experience, all Windows professionals often see four hundred internal PHP server errors due to poor permissions and website image ownership. On Windows servers, every file, not to mention folders, has its own rights. Here also some permissions can be inherited from top-level folders to run. And if the PHP binary does not have enough permissions to validate scripts, it can result in an Internal Server 500 error.
Similarly, file ownership in general also creates problems. On Windows, some users, such as IIS users, IIS WP users, etc., need to be able to access the folders and files of the website. For example, an IUSR map must have permissions to modify php using scripts. If and, there are problems with confirmation, the website displays PHP errors.
2. Incorrect PHP Settings
Another reason for an internal PHP server error is incorrect PHP configuration. The php parameters are specified in the configuration file in the C: PHP PHP.ini folder. The PHP binary takes values from this File when executing scripts.
PHP timeouts are a simple example. When it seems like the PHP scripts of a website need to get results from external systems, PHP timeouts often cause problems. Most administrators set timeouts in PHP to avoid misusing server resources. And if your PHP script runs longer than the thresholds during the day, be aware that this will eventually result in a 500 error.
3. PHP Module Error
About 500 real errors when your server’s PHP module is corrupted as such. Therefore, using the results when processing PHP scripts can lead to errors.
Fortunately, IIS often displays a certain incremental error message when a website reports a 500 error due to module errors:
500.0 Or an ISAPI module error has occurred.500.21 Module not recognized.
How We Fixed An Internal IIS PHP 500 Server Error
Several steps are required to troubleshoot PHP 500 internal site error in IIS. Now let’s see how each specialized engineer solved the problem One of our clients and made the PHP scripts work.
Client reported Server 200 Internal Error on a noisy WordPress site in IIS.
1. Activate Display Error
While the error correctly indicated that PHP was throwing a 500 error, the game did not provide any application-specific information about the cause of the error. So the first step was to review to activate the possibility of display errors. Our dedicated engineers followed the next steps.
- Using Windows® Explorer, navigate to the C: PHP folder and open the Php.ini file in the PHP installation directory.
- Edit and set the display_errors = On statement.
- Save the .IIS file.
- Reset with all iisreset.exe commands
After enabling complications, we reloaded PHP, after which a PHP parsing error was displayed:
Parse error: parse error at line C: inetpub users xxx httpdocs mysite error.php before 3 >>
Often, browser settings only display clear error messages. In such situations, we advise the purchaser to turn off the power. For example, in Internet Explorer neGo to Tools, Internet Options, Tab, Advanced and uncheck Show clear HTTP error messages.
So it was a code error in the PHP script. We offered the client changes in the script and fixed the experts who reported the error.
2. Execute PHP Script Locally
Another way to find the exact error is to run my PHP script on the server. To do this, our support engineers connect the server through rdesktop and activate the PHP script using the php.exe binary. This will indicate that the DLLs are conflicting and will generate a 500 error. We will correct these differences and run the script again.
3. Correct PHP Settings
In some cases today we need to fix PHP bundles to fix the problem. When a client recently reported problems with their website, we had to properly check the open_basedir php directive to fix the 500 internal server error.
Even though php cgi scripts may display a number of warnings, IIS7 HTTP still displays a great 500 error message. Although a great method is to restore the P scriptsHP, you can often change the error handling for FastCGI in IIS7, and you can also use IgnoreAndReturn200 as a permanent solution. The exact settings are displayed in Outlook as.
4. Recover PHP Binary
In rare cases, a fix could mean a complete rework of the PHP binaries on the server. This happens when traditionally the PHP program on the site is corrupted. However, in such packages, our dedicated engineers will always check how much you rely on the package and perform a reinstallation. For map servers targeting specific controls, we install the appropriate binary on the server.
[Broken PHP scripts causing big problems? IIS will find a solution for you.]
Conclusion
In short, an internal PHP 500 server error present in IIS mainly occurs due to some reasons such as faulty PHP scripts, incorrect computer settings, and more. Today, many of us have seen the root causes of the nature of the error and how our support team develops them for the client tov.
PREVENT YOUR SERVER FROM DAMAGE!
Never lose clients due to poor server speed again! Let the United States of America help you.
Our server specialists guard and maintain your server 24 hours a day to keep it super-fast and therefore secure.
Download this software and fix your PC in minutes.
Step 1. Fix the problem.Step 2: drain. … … … htaccess file.Step 3: debug. htaccess problems.Step 4: Increase PHP memory limit.Just five steps: Make sure the administrator is working.Step nine: undo the latest changes.Step 7. Check your plugins / extensions / modules.Step 8: Check the file permissions.
On the home page of the search engine results page in IIS Admin, double-click ASP, increase the debug properties, select the Send browser errors check box, and then click Apply. From the start screen, under Error Pages, select 500, then Change Feature Settings and Detailed Errors. Note that the same steps apply for IIS 8.0 (Windows Server 2012).
Errore Interno Del Server 500 Php Iis
Interne Serverfout 500 Php Iis
Erreur De Serveur Interne 500 Php Iis
내부 서버 오류 500 Php Iis
Interner Serverfehler 500 Php Iis
Erro Interno Do Servidor 500 Php Iis
Internt Serverfel 500 Php Iis
Vnutrennyaya Oshibka Servera 500 Php Iis
Wewnetrzny Blad Serwera 500 Php Iis
Error Interno Del Servidor 500 Php Iis