Jonathan
Jonathan

Reputation: 32858

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

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:

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.

Upvotes: 2

Views: 20385

Answers (3)

Lex Li
Lex Li

Reputation: 63123

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

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.

Upvotes: 2

argonym
argonym

Reputation: 892

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.)

Upvotes: 0

Mark Brown
Mark Brown

Reputation: 8763

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

Upvotes: 2

Related Questions