Cable Forum

Cable Forum (https://www.cableforum.uk/board/index.php)
-   General IT Discussion (https://www.cableforum.uk/board/forumdisplay.php?f=19)
-   -   Installing PHP on IIS 6.0 (Windows 2003)? (https://www.cableforum.uk/board/showthread.php?t=13312)

Caspar 07-06-2004 12:26

Installing PHP on IIS 6.0 (Windows 2003)?
 
I've just installed the latest PHP version (PHP 4.3.7 installer [1,048Kb] - 02 June 2004) on my windows 2003 server.

I'm now getting an error, which seems Apache related

Quote:

Security Alert! The PHP CGI cannot be accessed directly.
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.

For more information as to why this behaviour exists, see the manual page for CGI security.

For more information about changing this behaviour or re-enabling this webserver, consult the installation file that came with this distribution, or visit the manual page.




Any clues on how to fix this?

Richard M 07-06-2004 12:38

Re: Installing PHP on IIS 6.0 (Windows 2003)?
 
Did you copy php.ini to c:/windows/ ?
It's best to use php.ini-recommended, copy this to c:/windows/ then rename it to php.ini.

Caspar 07-06-2004 12:40

Re: Installing PHP on IIS 6.0 (Windows 2003)?
 
Yeah php.ini is there. Don't know where php-ini-recommended is tho?

gazzae 07-06-2004 12:43

Re: Installing PHP on IIS 6.0 (Windows 2003)?
 
http://www.phpbuilder.com/lists/php-...02122/0038.php

Quote:

From the webpage....
I have posted the solution to this on the php-windows mailing list. When
you install PHP on .Net (rather, IIS 6.0) you have to manually add in the
ISAPI or CGI into the IIS Control Panel. Once you have done that, there
is
a "Web Service Extensions" or something to that effect in the IIS Control
Panel. You have to manually setup a rule to allow the php.exe to run.
Once
you have this done, php should be able to run without problem. If you
need
any further help, please feel free to contact me and I'll walk you through
the setup.

Caspar 07-06-2004 13:00

Re: Installing PHP on IIS 6.0 (Windows 2003)?
 
I tried that and no help :(


tbh, I then read the link and the post asking help is already in reply to the above help...so it was never going to help anyway! :(

Richard M 07-06-2004 13:04

Re: Installing PHP on IIS 6.0 (Windows 2003)?
 
Is there any reason why you can't use Apache on this machine?

Caspar 07-06-2004 13:11

Re: Installing PHP on IIS 6.0 (Windows 2003)?
 
I use IIS for an ASP applilication. I need PHP and MYSQL for VBulletin.

No, I suppose but I feel reluctant to install it. I simply don't have time.

gazzae 07-06-2004 13:20

Re: Installing PHP on IIS 6.0 (Windows 2003)?
 
What about this?

http://forums.susserver.com/index.ph...opic=638&st=75

Quote:

mostly its a setting in the php.ini file, normaly placed in %WINDIR% .
there is a switch called cgi.force_redirect, this switch has to be zero.
cgi.force_redirect = 0
Heres another link about it which says pretty much the same
http://forums.devshed.com/archive/t-44144

Caspar 07-06-2004 13:23

Re: Installing PHP on IIS 6.0 (Windows 2003)?
 
It's 0 (zero) by default :confused:

gazzae 07-06-2004 13:26

Re: Installing PHP on IIS 6.0 (Windows 2003)?
 
Quote:

Originally Posted by Caspar
It's 0 (zero) by default :confused:

Its not commented out or anything is it?

Caspar 07-06-2004 13:30

Re: Installing PHP on IIS 6.0 (Windows 2003)?
 
Nope there's no ; before it?

Can I just confirm that 0 (zero) means OFF, it's not some dodgy PHP inverted thing ao anything!!! :)

Richard M 07-06-2004 13:45

Re: Installing PHP on IIS 6.0 (Windows 2003)?
 
Correct. :)

gazzae 07-06-2004 13:50

Re: Installing PHP on IIS 6.0 (Windows 2003)?
 
Did you restart the server after making the change?

Caspar 07-06-2004 13:53

Re: Installing PHP on IIS 6.0 (Windows 2003)?
 
I have, even rebooted the server a few times :Yikes:

gazzae 07-06-2004 13:55

Re: Installing PHP on IIS 6.0 (Windows 2003)?
 
Are you sure its reading the correct ini file? try this, if this doesn't work I've no idea. sorry

12. How do I know if my php.ini is being found and read? It seems like it isn't as my changes aren't being implemented.

To be sure your php.ini is being read by PHP, make a call to phpinfo() and near the top will be a listing called Configuration File (php.ini). This will tell you where PHP is looking for php.ini and whether or not it's being read. If just a directory PATH exists than it's not being read and you should put your php.ini in that directory. If php.ini is included within the PATH than it is being read.

If php.ini is being read and you're running PHP as a module, then be sure to restart your web server after making changes to php.ini

gazzae 07-06-2004 14:02

Re: Installing PHP on IIS 6.0 (Windows 2003)?
 
Maybe this is another option

http://www.tek-tips.com/viewthread.c...pid=434&page=1

Quote:

I found out that you set the environment variable REDIRECT_STATUS to FALSE and it works!

Caspar 07-06-2004 14:06

Re: Installing PHP on IIS 6.0 (Windows 2003)?
 
Quote:

Originally Posted by gazzae
Are you sure its reading the correct ini file? try this, if this doesn't work I've no idea. sorry

12. How do I know if my php.ini is being found and read? It seems like it isn't as my changes aren't being implemented.

To be sure your php.ini is being read by PHP, make a call to phpinfo() and near the top will be a listing called Configuration File (php.ini). This will tell you where PHP is looking for php.ini and whether or not it's being read. If just a directory PATH exists than it's not being read and you should put your php.ini in that directory. If php.ini is included within the PATH than it is being read.

If php.ini is being read and you're running PHP as a module, then be sure to restart your web server after making changes to php.ini


sorry to say but the test page I'm using is only a simply phpinfo() call :(

gazzae 07-06-2004 14:10

Re: Installing PHP on IIS 6.0 (Windows 2003)?
 
What about the environment variable did you try changing that?

Richard M 07-06-2004 14:13

Re: Installing PHP on IIS 6.0 (Windows 2003)?
 
Quote:

Originally Posted by gazzae
If php.ini is being read and you're running PHP as a module, then be sure to restart your web server after making changes to php.ini

AFAIK, IIS only uses the CGI version of PHP. (php.exe)

Caspar 07-06-2004 14:15

Re: Installing PHP on IIS 6.0 (Windows 2003)?
 
Quote:

Originally Posted by gazzae
What about the environment variable did you try changing that?

What environment variable? :erm:



Quote:

Originally Posted by Richard M
AFAIK, IIS only uses the CGI version of PHP. (php.exe)

agreed, well that's what I've installed, see post #1

gazzae 07-06-2004 14:17

Re: Installing PHP on IIS 6.0 (Windows 2003)?
 
Quote:

Originally Posted by Caspar
What environment variable? :erm:

My other post above

http://www.cableforum.co.uk/board/sh...8&postcount=16

Caspar 07-06-2004 14:18

Re: Installing PHP on IIS 6.0 (Windows 2003)?
 
Quote:

Originally Posted by gazzae


No difference :(

p.s. the link you posted redirected me to their homepage :( and a search for REDIRECT_STATUS returned nothing :confused:

Caspar 07-06-2004 14:21

Re: Installing PHP on IIS 6.0 (Windows 2003)?
 
Quote:

Originally Posted by Caspar
p.s. the link you posted redirected me to their homepage :( and a search for REDIRECT_STATUS returned nothing :confused:

Are you a member I take it of that forum, cause it says you have to be a member to search :(

gazzae 07-06-2004 14:22

Re: Installing PHP on IIS 6.0 (Windows 2003)?
 
I've no idea mate.

The tek-tips site, try searching by "Security Alert! The PHP CGI cannot be accessed directly" and make sure you change the drop down menu beside the search box to "Search Posts (Keywords)"

Caspar 07-06-2004 14:34

Re: Installing PHP on IIS 6.0 (Windows 2003)?
 
ok, it's sorted :tu:

I got so fed up with this...check how long we've been battling this beast for today!!! :(

Anyway, I decided to copy and paste the php.ini to everyplace in the dir strc I could think of!!!!

It ended up to be valid in C:\PHP\php.ini



Case closed and thanks to gazzae and Richard M :tu: :D

gazzae 07-06-2004 15:00

Re: Installing PHP on IIS 6.0 (Windows 2003)?
 
Glad you got it sorted!


All times are GMT. The time now is 06:27.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
All Posts and Content are © Cable Forum