The FastCGI process exited unexpectedly
Asked Answered
N

18

38

I am trying to run PHP via FastCGI on a Windows 2008 server.

I followed this installation doc http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis7/ and have checked I completed the steps correclty numerous times.

However when I try to execute a php page i am presented with the following error:

HTTP Error 500.0 - Internal Server Error C:\PHP\php-cgi.exe - The FastCGI process exited unexpectedly

Notum answered 11/4, 2014 at 8:38 Comment(2)
possible duplicate of IIS 7.5 PHP failure "The FastCGI process exited unexpectedly"Therianthropic
I restarted fastcgi settings, handler mappings, CGI from IIS Manager(Windows 10) and it showed my test php page.Hosmer
F
9

You might be using C:/[your-php-directory]/php.exe in Handler mapping of IIS just change it C:/[your-php-directory]/php-cgi.exe.

Footstall answered 22/1, 2015 at 11:25 Comment(2)
I knew I mis-configured something. All other settings and software dependencies were there, and executing a PHP file from command-line was working. However, only IIS was throwing the FastCGI run-time error.Contrary
This worked for me.Could not believe changing from "php.exe" to "php-cgi.exe" made it worked. Also I made the change on sub directory like mydir/mysuba/mysubB in the handler mapping. Thank you Akshay KhaleCartie
R
87

maybe you should try installing VC++ runtime as explained here.

There's a fairly good chance you're missing the correct VC++ runtime for the version of PHP you're running.

If you're running PHP 5.5.x you need to ensure the VC++11 runtime is installed:

http://www.microsoft.com/en-us/download/details.aspx?id=30679

Make sure you download and install the x86 version (vcredist_x86.exe), PHP on Windows isn't 64 bit yet.

If you're running PHP 5.4.x then you need to install the VC++9 runtime:

http://www.microsoft.com/en-us/download/details.aspx?id=5582

Rollins answered 8/3, 2015 at 18:29 Comment(6)
Thank you. It works. For PHP 5.6, also please do same as 5.5.xDisarticulate
That was it for me as well on Azure VM Server 2012 R2! Thank you!Evaporate
Huge help! This worked for me installing 5.6 on Windows 2012. I installed the x86 version using your first link. After that it just worked. ThanksNepheline
That did it for me!Popliteal
For PHP 7.x it's VC++ 15. It was necessary to install both 64bit and 32bit versions, even the windows server was 64bit.Wheels
if problem doesnt solve, try running php-cgi.exe directly (cmd line) as mentioned by Akshay Khale and get to know the message. in my case it was VC++ 14Slugabed
H
37

When you run php-cgi.exe from the dos command line, you will get the missing MSVCR110.dll pop up message.

Like Ben said, Get the x86 download for the dll here: http://www.microsoft.com/en-us/download/details.aspx?id=30679

Hahnert answered 11/11, 2015 at 15:41 Comment(6)
THANK you for saving my life!Gleaning
Thanks for specifying x86, I got the wrong version the first time :)Visitor
Worked for me too. Server was running IIS Express.Lambskin
THIS SHOULD BE THE CORRECT ANSWER IT WORKSCrelin
For me, it showed an info about an obsolete config flag - removing it solved my problem (installed redists beforehand)Ahumada
Works for windows server 2019 with IIS 10,thxHalfcaste
B
17

After much pain and suffering, turns out I needed to install the "Visual C++ Redistributable for Visual Studio 2012 Update 4 32-bit version", even on my 64-bit server.

Bethina answered 4/11, 2015 at 22:6 Comment(4)
Yes exactly. I had installed PHP 5.6 on IIS on Windows server 2012 R2. Didn't work after x64 VC++ but worked after x86 and restarting IIS.Tragedian
Yes, this is required. I think as the php is 32 bit on windows that is why x86 version of c++ redistributable package is required to be installed. If the server(computer) is 64 bit then it is better to install both version (64bit and 32bit) of visual c++ redistributable package.Oslo
What a pain. Visual C++ Redistributable errors are like the old Win 3.1 DLL conflicts all over again. Needed to uninstall all the ones I already had, then install them all again starting from oldest and working up to newest. Solved the problem though!Whosoever
Yep, this fixed it. Specifically it had to be the 32bit (x86) version.Twirl
D
11

If you are installing PHP 7.1.14 on windows server 2008 rc2 Enterprise, only thing worked for me is to install microsoft Visual C++ 2015 Redistributable Update 3 from https://www.microsoft.com/en-us/download/details.aspx?id=53587

Depone answered 16/5, 2017 at 17:34 Comment(2)
Worked for me on Windows Server 2016, PHP version 7.1, thanks...Pantia
Thank you, this worked for me on Windows 2012 standard server. Cheers!Interrogative
I
10

I tried opening php-cgi.exe directly and it gave me a more clear error message.

Ilarrold answered 13/9, 2015 at 1:24 Comment(0)
F
9

You might be using C:/[your-php-directory]/php.exe in Handler mapping of IIS just change it C:/[your-php-directory]/php-cgi.exe.

Footstall answered 22/1, 2015 at 11:25 Comment(2)
I knew I mis-configured something. All other settings and software dependencies were there, and executing a PHP file from command-line was working. However, only IIS was throwing the FastCGI run-time error.Contrary
This worked for me.Could not believe changing from "php.exe" to "php-cgi.exe" made it worked. Also I made the change on sub directory like mydir/mysuba/mysubB in the handler mapping. Thank you Akshay KhaleCartie
P
3

As the answer of 'sepehr' this issues are because of VC++ Redistributable suitable version for PHP are not installed or need to be reinstalled again.

I faced it before so i'll explain my steps to fix it.

1- Each PHP version is built by a specific Visual C++ Redistributable version like (10, 11,12,14,..) what ever. ((How you know!! look.. ))

  • Check back enter link description here The PHP Site then at the left side of this page, look at "Which version do I choose?" then see what version of VC++ is fits your PHP version installed.

  • Now YOU HAVE TO Download both of VC++ 32 and 64. and if your PC has it already then Unistall them first. and then install what you downloaded recently bu (first 32 then 64).

- VC download links are exists on the mentioned PHP Site on the left side also.

I hope it helps you.

Pettis answered 4/5, 2017 at 8:58 Comment(1)
Nice - I installed the VC redists - but version thing I got to know from your comments. Thanks.Supplication
R
1

if you have two application like (your app, phpmyadmin) just disable APC extension Hope that fix that issue it's worked with me

Russianize answered 23/3, 2015 at 10:16 Comment(0)
R
1

For user using PHP 5.6.x follow this link and install the x86 version.

Roue answered 18/11, 2016 at 19:11 Comment(0)
S
1

I have installed the latest version of Visual C++ Redistributable from this link for php 8.0.0 x86:

and my problem was solved.

Sevilla answered 10/10, 2021 at 6:16 Comment(0)
E
1

Running php-cgi.exe from the command line gave a message like the vcrt dll is a lower version than what is linked in php. Using Visual C++ redistributable package 64 bit 14.29 solved the above problem for me.

Elliellicott answered 26/11, 2022 at 16:14 Comment(0)
S
0

In my case the problem was coming through the application pool. Try to change your application pool ASP.NET v4.0.

Sateen answered 25/8, 2014 at 10:45 Comment(0)
S
0

In my case I had wrong constellation of configurations:

  • error reporting disabled
  • typo error in the configuration

After enabling the error_reporting it was clear the session_path was pointed to a wrong folder.

"Sad but true"

Syncopate answered 9/10, 2016 at 15:2 Comment(0)
M
0

I was getting this same error installing PHP 7 on Windows Server 2008 R2. I resolved this by installing the Visual C++ Redistributable for Visual Studio 2015.

Madelon answered 2/2, 2017 at 20:55 Comment(1)
And It's necessary to install x86 version, x64 wouldn't solve the 500 error but x86 fix it totallyCinderella
R
0

For Issue C:\PHP\php-cgi.exe - The FastCGI process exited unexpectedly.

I resolved this by installing the Visual C++ Redistributable for Visual Studio 2015.(Microsoft Visual C++ 2015 Redistributable Update 3) and Visual C++ Redistributable for Visual Studio 2012 Update 4 in 32 and 64bit versions. and also make sure in php.info file cgi.fix_pathinfo=0 enabled.

Rooney answered 26/1, 2018 at 6:24 Comment(0)
H
0

I got this error too after I changing PHP version in windows. I have PHP Manager plug in of IIS installed, it show the PHP is not enabled, then I fix this issue after doing "Register new PHP version" enter image description here

Haft answered 20/7, 2021 at 2:51 Comment(0)
A
0

I struggled for hours with that problem, and no solution worked for me. May seems obvious or very foolish, but my error was in PHP 5.6 version. I was using PHP 5.6 from XAMPP, but if you download PHP on IIS with Web PI (Microsoft Web Platform Installer) it's more suitable for IIS instead XAMPP version.

More Info:

https://stackify.com/how-to-host-php-on-windows-with-iis/

Armillary answered 22/9, 2021 at 13:37 Comment(0)
A
0

Got this error today on IIS 10 with PHP 8.3.8 today. Happened all of a sudden after everything was running fine.

As suggested, ran php-cgi.exe from command line and received the error

Directive 'track_errors' is deprecated

Solution is described here: Directive 'track_errors' is deprecated

Updated php.ini with track_errors=Off and no more errors

Assiut answered 23/6, 2024 at 19:20 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.