Why am I getting error 0x80070585 when trying to run a PHP application on IIS 7?

2

I'm running IIS 7 on Windows 7.

I've installed PHP v5.3 through WebMatrix, set up a website for my PHP app in IIS, and enabled read/write access for 'Everyone', for the directory.

When I browse to the application, I get the following error:

HTTP Error 500.0 - Internal Server Error
<handler> scriptProcessor could not be found in <fastCGI> application configuration
Error Code  0x80070585

Here's what I tried:

  • Ensured that CGI is installed (Windows Features --> Internet Information Services --> World Wide Web Services --> Application Development Features --> CGI; it was already ticked.)

  • Commented out all of extensions under the '[ExtensionList]' section in 'php.ini'.

  • Noticed some discussion online about editing a file called 'fcgiext.ini'. Did a file-search on my hard drive for this file; 0 results.

  • Noticed this discussion, advising that whatever is in the scriptProcessor attribute of the handlers section should also be in the fastCgi section. But I already have a file called 'Web.roleconfig' in my PHP application path, which already has a fastCgi section:

    <fastCgi>
      <application fullPath="%RoleRoot%\approot\Php\php-cgi.exe" arguments="-c %RoleRoot%\approot\Php\php.ini" />
    </fastCgi>
    

Sorry if this is all a bit incoherent. I'm not a PHP expert, and I'm not sure where to begin to solve this problem.

At the least, any hints as to whether this is an IIS or PHP or FastCgi issue would be a great help.

php
iis-7
fastcgi
asked on Stack Overflow Aug 19, 2011 by Jonathan • edited Nov 7, 2015 by pnuts

3 Answers

2

I'd try using PHP Manager to see if PHP is configured correctly for IIS.

Install PHP Manager from here, http://phpmanager.codeplex.com/

Then run it within IIS (appears as a module in IIS Mgr) to see if PHP is registered. If it isn't, click Register New version, navigate to php-cgi.exe and select it. Then click on Check PHPInfo() to ensure it's running.

Hope that helps. Mark

answered on Stack Overflow Aug 24, 2011 by Mark Brown
0

All solutions proposed above are based on tools. The underlying IIS mechanism for FastCGI support was not mentioned in details, but is the key to get things right.

  1. PHP binaries for Windows must be extracted somewhere and you need to get its php.ini ready.
  2. Add a module mapping in Handler Mapping section of IIS Manager (or equivalently in applicationHost.config file) at server or site level.
  3. Make sure at server level's FastCGI Settings section of IIS Manager the php-cgi.exe is registered (though at previous step IIS Manager should ask if you want it to help add this entry automatically).

This IIS.net article lists more info, but it failed to mention the last step,

https://www.iis.net/learn/application-frameworks/scenario-build-a-php-website-on-iis/configuring-step-1-install-iis-and-php#13

while this PHP page reveals almost everything with screenshots,

https://secure.php.net/manual/en/install.windows.iis7.php

If you get 500.0 and 0x80070585, it is very likely that the last two steps are not completed, and you need to go back to IIS configuration.

answered on Stack Overflow Aug 23, 2015 by Lex Li
0

You need to include the (Fast)CGI applications's arguments in the handler definition.

Unfortunately, this is not described in the add handler documentation, but just appears in sample documentation (1, 2) about setting up PHP with IIS:

To create these mappings, the settings in the fullPath and arguments attributes for an element must be added to the scriptProcessor attribute in the mapping for the FastCGI process and separated by the pipe "|" character.

So in your particular case the scriptProcessor within the handler definition would need to be set to:

<handlers>
  ...
  <add ... scriptProcessor="%RoleRoot%\approot\Php\php-cgi.exe|-c %RoleRoot%\approot\Php\php.ini" />
  ...

(Haven't checked if the env vars don't cause a mapping issue, though.)

answered on Stack Overflow May 19, 2016 by argonym

User contributions licensed under CC BY-SA 3.0