22

I've been attempting to get PHP working with IIS 7.5 and have hit a bit of a roadblock. Whenever I try to load the page I get the following error:

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

Module FastCgiModule

Notification ExecuteRequestHandler

Handler PHP_via_FastCGI

Error Code 0x00000000

Requested URL *http://localhost:80/index.php

Physical Path C:\inetpub\wwwroot\index.php

Logon Method Anonymous

Logon User Anonymous

Failed Request Tracing Log Directory C:\inetpub\logs\FailedReqLogFiles

I've modified the PHP.ini file as required for use with IIS, and have also switched it to verbose mode. There isn't any log fiel in C:\inetpub\logs\FailedReqLogs, and none related to this error in the other log files generated.

I've tried the other fixes I've found here and elsewhere but nothing's been successful so far.

In some detail these were: re-checking PHP.ini Setting up fastCGI to work with PHP in IIS (configuring it to load the php.exe) Trying WinCache as the execution method.

Vilid
  • 331
  • 1
  • 2
  • 4

10 Answers10

50

I had this problem when I upgraded PHP 5.4.14 to 5.5.3 (32-bit).

To fix it I had to install the Visual C++ Redistributable for Visual Studio 2012 Update 3

I found out that I needed this DLL by running php --version from the console when my web pages no longer loaded after the upgrade. Which then revealed that I needed the MSVCR110.dll, that comes with the 32-bit VS redistributable update from MS. Since I have optional updates turned off in Window Update, I did not get it automatically.

They also come in different flavors (32-bit, 64-bit, and ARM) 32-bit is what worked for me.

b01
  • 4,076
  • 2
  • 30
  • 30
  • 4
    This is also stated on the left side-bar on http://windows.php.net/download/#php-5.5 Which I usually overlook, now that I've been using it for so many years. – b01 Sep 02 '13 at 16:37
  • Same issue updating from php 5.4.x to 5.5.x Solved the problem! Thx – Wilt Sep 25 '13 at 12:38
  • 2
    I added bold to highlight that it is the 32bit (x86) version of the VS redistributable that's needed. – Håkon K. Olafsen Apr 05 '14 at 16:49
  • Looking at event log applications error is greatly helpful, it told me something about a problem with MSVCR110.dll, thus indicating Visual C++ runtime in 2012 version (code 110). – barbara.post Oct 24 '14 at 12:24
  • 3
    Just to clarify, you really need the x86 build for this to work. The x64 build does NOT work, despite what it says on the php website. – The Cookies Dog Nov 14 '14 at 11:28
  • @Areius can you provider further info? – Moz Morris Feb 19 '15 at 17:17
  • The link above is the 64-bit version of VC++ Redis. You need the 32-bit version, otherwise it won't help. – The Cookies Dog Feb 20 '15 at 08:39
  • This fixes the problem. I did a fresh shiny install of PHP 5.6 (on Win2k12) from Web Platform installer. It didn't work out of the box until I installed this VC++ redistrib. I don't trust folks, so I verified the issue ahead of time by trying to run php --version from the command line like b01 said. It worked. Thanks! – Marcus Dec 20 '15 at 19:27
10

Install the 32 bit of Visual C++ Redistributable for Visual Studio 2012 Update 4

NOT the 64 bit

piris
  • 1,547
  • 3
  • 22
  • 26
4

It seems that there are some dll extension in your php which are not work properly and force the CGI closed. Try to comment every extensions in php.ini file and see whether the error will exist or not.

[EDIT 1]

After some struggles I found out that the IIS is non thread safe web server and all the extension which you want to use in php for IIS should used nts lib for compiling. If the extension compile with thread safe library and add to IIS the IIS would not start. In this case your extension in thread safe(used in apache I guess) and should not add as an extension in IIS

A23149577
  • 2,045
  • 2
  • 40
  • 74
3

Is this page you're trying to hit doing anything intensive?

I've had this problem before, and the error message was misleading.

You might want to try increasing your memory limit for that particular page. First find out the peak memory usage for that page:

echo memory_get_peak_usage(true);

Then set your memory limit appropriately:

ini_set("memory_limit","1024M");

Hope that helps!

seb835
  • 467
  • 1
  • 5
  • 19
1

I know its an old thread, but someone might save some headbashing.

In php.ini, changing

; Whether or not to enable the dl() function.  The dl() function does NOT work
; properly in multithreaded servers, such as IIS or Zeus, and is automatically
; disabled on them.
; http://php.net/enable-dl
enable_dl = Off

to

; Whether or not to enable the dl() function.  The dl() function does NOT work
; properly in multithreaded servers, such as IIS or Zeus, and is automatically
; disabled on them.
; http://php.net/enable-dl
;enable_dl = Off

Having enable_dl = Off doesn't work, commenting out the entire line does.

Donald H.
  • 11
  • 1
1

I had this problem when I was configuring PHP 5.4.17(32-bit).

To fix it I had to install the Visual C++ Redistributable for Visual Studio 2012 Update 4 and it worked fine after installing this update.

Gottlieb Notschnabel
  • 9,408
  • 18
  • 74
  • 116
Pacsal
  • 11
  • 1
1

As mentioned correctly in above answers it's related to "Visual C++ Redistributable" that's not installed or not installed correctly.

Depending on my expertise on this issue.

1- First take care, each PHP version depends on specific Visual C++ Redistributable version (11,12,14,..)

so first is to check back your PHP version with the notes on the left side of php site:
PHP Download page search for "Which version do I choose?" then see what version of VC++ is required to you.

2- YOU HAVE TO Download VC 32 and 64 BOTH. and check if your PC has it already so Unistall both of them (for the same version only). and then install 32 first and 64 after. (no need for any restarts unless it asks).

3- Complete the php installation other steps for iis, apache or ....

I hope it helps you.

Mohamed Abulnasr
  • 589
  • 7
  • 18
1

This may be because required libraries are not available. Run the php-cgi.exe from a command prompt and see if it executes successfully. It should output some HTML if it is working. I was getting a general 0xFFFFFFFF error code - which is not very helpful.

If it instead returns an error, resolve this before continuing.

I had installed the Visual C++ runtimes as indicated, but the minor version was older than the one used to compile the executable and it failed on starting.

After applying a later version of the same runtime, the program ran normally.

Many of the other suggestions talk about this, but fail to provide a simple test. See The FastCGI process exited unexpectedly for a similar question.

Pekka
  • 3,529
  • 27
  • 45
0

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

if not just install Microsoft visual C ++ 86 and 64

0

I have the same problem, which I fixed by installing the 32 bit of Visual C++, redistributable for Visual Studio 2012. 64 bit doesn't work for me.

Nathaniel Ford
  • 20,545
  • 20
  • 91
  • 102
LuisG
  • 11