34

When attempting to run a PHP file on Windows server 2012 and IIS, I keep getting a 500 error. I cannot find any detailed logs or anything. However, when going to PHP Manager for IIS and click check config, I get the following error:

Detailed Error Information:
Module    FastCgiModule 
Notification    ExecuteRequestHandler 
Handler    PHP55_via_FastCGI 
Error Code    0xc0000135 
Requested URL    http://domain.com:80/brkld3ip.php 
Physical Path    drive:\sites\domain.com\brkld3ip.php 
Logon Method    Anonymous 
Logon User    Anonymous 

I installed PHP using Microsoft Web Platform Installer 5.0 on a fresh install of Windows Server.

I am new to IIS coming from Linux. So I am not "learned" enough in IIS to know what's going on. I have tried updating C++ redistributable 2012 update 4 as a couple websites suggest. Anybody have any other ideas?

EDIT: Another thing I checked was memory limit. One site suggested my memory limit needed to be upped. No change.

EDIT: Question: Does Windows have to be rebooted for PHP changes to take effect?

the
  • 468
  • 8
  • 23
alexander7567
  • 541
  • 2
  • 6
  • 18

4 Answers4

54

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

Kev
  • 7,877
  • 18
  • 81
  • 108
  • 1
    You was correct. I already did the x64 since it was a 64 bit machine. Installed the x86 and instantly (no reboot required) it started working. Thanks! I racked my brain for hours! – alexander7567 Jul 20 '14 at 13:04
  • Brilliant! Fixed it immediately for me as well. +1 – Will Appleby Mar 25 '15 at 23:21
  • 2
    Thanks! PHP 5.6 instance requires VC++ 11 (VS 2012) runtimes – dynamiclynk May 20 '15 at 16:22
  • Thanks ! Originally missed the part about x86 but after failing miserably I saw what I missed and everything works fine now. – Alexandre Danault Dec 08 '15 at 14:20
  • 6
    For anyone having this issue with **PHP 5.6**, you need the **x86** version of **Visual C++ Redistributable for Visual Studio 2012 Update 4** *(vcredist_x86.exe)*, which can be obtained from the following page: https://www.microsoft.com/en-us/download/details.aspx?id=30679 – Derek Foulk May 12 '16 at 22:17
  • @kev you're a life-saver. Fixed it immediately. I specifically created an account to leave this message to say thank you! – Weipeng Nov 27 '16 at 02:11
  • @pongba - glad I could help :) – Kev Nov 28 '16 at 19:36
  • Brilliant! saved my day! – Anass Feb 13 '17 at 19:52
  • Oh my God... 2 days.. I was almost getting crazy man... It was the 64 bit issue. As soon as I downloaded x86, it just worked.... THANKS – curiousBoy Nov 15 '17 at 04:41
  • For PHP 7.2.x use VC++ 2015 with the correct bit version (x64, x86, depending on the bit version of PHP) – Martin Braun Mar 15 '18 at 15:19
  • Granted it's 4 years later but the 64b version worked for me with the 64b PHP, just in case this helps anyone. – mindmischief Sep 20 '18 at 22:46
  • @mindmischief - thanks for that info. After four years I'm amazed those links still work :) – Kev Sep 21 '18 at 09:21
  • @derekmx271 Yupe that's right, php 5.6 requires VC++ 2012 x86. I have installed x64 but not the x86. ah~~~, have been trying to fix this the whole morning. – mjb Jan 24 '22 at 03:40
6

I got caught out by a similar message, and it turned out that I had not installed the CGI Server Role (under IIS -> Application Development).

From Orbonia
  • 161
  • 1
  • 3
  • How similar is the message? – Deer Hunter Apr 06 '15 at 09:26
  • I installed the VC++ 11 runtime but I also had to install CGI support to get it working. On Windows 8.1 and IIS 8.5. Find it under `Turn windows features on or off > Internet information services > application development features > CGI` – jxmallett Jul 04 '15 at 03:42
4

I had the same error for PHP 7.0.3 on a 2012 R2 server with IIS 8.5.

The solution is to install: Visual C++ Redistributable for Visual Studio 2015 32bits

Everything worked properly after installing this.

Will
  • 1,147
  • 10
  • 26
Tidoy007
  • 41
  • 2
1

Still had the 500 error after installing the Visual C++ Redistributable for Visual Studio 2015 32bits.

Ran procmon from microsoft sysinternals and when requesting my php web page found

w3wp.exe C:\PHP\php-cgi.exe "ACCESS DENIED"

w3wp.exe is the app pool running under IIS

Giving the specific app pool user READ/EXECUTE permissions to c:\php fixed the issue.

rob
  • 139
  • 1
  • 9