StephenPAdams
StephenPAdams

Reputation: 2817

PHP5 ISAPI on Windows 7 (64 bit)

I'm getting this message:

This PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a page will only be served up if the REDIRECT_STATUS CGI variable is set, e.g. via an Apache Action directive.

However, I've set cgi.force_redirect equal to 0, and have reset IIS. I've done the following as well:

  1. Added C:\PHP to my system PATH
  2. Ran this for the registry:

    Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\PHP] "IniFilePath"="C:\PHP"

  1. Added the PHP ISAPI to the ISAPI and CGI Restrictions as being allowed
  2. Added the PHP ISAPI as an ISAPI module mapped to *.php

However, I keep getting that error message. I've tried everything!

Upvotes: 2

Views: 1623

Answers (1)

Waleed Al-Balooshi
Waleed Al-Balooshi

Reputation: 6406

I believe that you need to edit the php.ini file and set:

cgi.force_redirect = 0

EDIT BASED on comments

In the same php.ini you will find

extension_dir = "c:\php5\ext"

change the directory to where you want it to be.

  1. The following bug report has people complaining about the same problem, and they ended up putting the php.ini in their c:\windows directory.

http://bugs.php.net/bug.php?id=42849&thanks=3

  1. Another option is to set a PHPRC environment variable with the location to php.ini ex. "c:\php"

The following link shows you the order in which the locations of php.ini are searched:

https://www.php.net/manual/en/configuration.file.php

Upvotes: 4

Related Questions