HTTP 500 Error on php document IIS 8 and PHP 7.0.2

I'm trying to migrate my LAMP application to Windows/IIS. I have a Windows 2012 R2 server. I'm following the instructions at https://technet.microsoft.com/en-us/library/hh994592.aspx (modified slightly: I used add-windowsfeature Web-Server -includeAllSubFeature to install IIS +CGI). I have the vc++ 2015 redist installed (both x86 and x64). PHP 7.0.2 is installed at d:\php. IIS Module Handler for php is configured:

name            : PHP_via_FastCGI
path            : *.php
verb            : *
modules         : FastCgiModule
scriptProcessor : D:\php\php-cgi.exe
resourceType    : Either
requireAccess   : Script

d:\php is in the PATH environment variable. My php.ini settings are the php.ini-development settings with these changes:

  • extension_dir = "ext"
  • cgi.force_redirect = 0
  • fastcgi.impersonate = 1
  • fastcgi.logging = 0
  • extension=php_ curl.dll
  • log_errors = On
  • error_log = syslog

The above configuration works on a Windows 7 desktop and on a 2012 R2 server NOT joined to the corporate domain, but on two 2012 R2 servers in the domain I get a 500 Internal Server error when trying to launch http://localhost/test.php.

c:\inetpub\wwwroot\test.php contains:

<?php phpinfo(); ?>

I'm not seeing any error information in the Windows Event log.

Running "php c:\inetpub\wwwroot\test.php" in the cmd window gives me the expected phpinfo.

I have checked the NTFS permissions on the d:\php folder and the c:\inetpub\wwwroot folder. They are too many to list, but SYSTEM has full control on both folders and the WWWPublishing service is running as Local System.

Any ideas of what to look for to find out why this isn't working?

Answers


As it turns out the IIS_IUSRS group needed full-control NTFS access to the d:\php folder.


Need Your Help

Error while serializing datetime property

vb.net wcf

When i include datetime property in object and return it in wcf service then it gives error status 12152. Without datetime property in my object it works fine. Datetime property content is #1/22/20...

nvarchar(max) converting to varchar and table optimization

sql-server sql-server-2008 database-design optimization

I am working with a table that has all character types set to nvarchar some of them are nvarchar(max). We are converting all these to varchar and specifying a character width based upon the actual ...