Click to See Complete Forum and Search --> : Problem with PHP installtion on IIS 6.0


Gecko24
11-07-2003, 03:27 PM
Hello,

I like to visualize some pages PHP in my server IIS 6.0 (Windows 2003 Server).
I downloaded and installed the file php-4.3.4-Win32.zip but when I try to visualize any page .php I get the following message:


The page cannot be found
The page you are looking for might have been removed,
had its name changed, or is temporarily unavailable


I'm trying to understand what's wrong and I'll appreciate any help you may provide.
I'll describe the best I can step by step what I'm doing and perhaps you can tell where things went wrong and how to correct it.


Step 1 : I decompressed the file php-4.3.4-Win32.zip in the folder c:\inetpub\php\


Step 2: I modified the following lines in files php . ini
extension_dir="c:\inetpub\php\extensions"
cgi.force_redirect=0


Step 3: I copied file php.in in the folder c:\windows


Step 4 : Then I copied the extensions DLL php4isapi.dll & php4ts.dll in folder c:\windows\system32\inetsrv.


Step 5 : I created a web site PHP_TEST in the IIS, with a file test.php that contains the following code :


<HTML><HEAD><TITLE>Essai_1</TITLE>
</HEAD><BODY>
Nous sommes le <? echo_date("d/m/Y"); ?>
</BODY></HTML>


Step 6 : I went to properties of my web site, in the IIS on the tab "Home Directory", I clicked on the button "Configuration", I added extension php as an executable "c:\inetpub\php\php.exe" and I checked the box "Script Engine"



Step 7 : At the user IUSR_*Computer name*, I granted rights to the folder in my web site PHP_TEST (c:\inetpub\PHP_TEST\).
And also granted rights to folder c:\inetpub\php\



Finally while in mode DOS I wrote "php -i" and I got several lines HTML which leads me to believe that my problem may come from my server's IIS"


Anybody got any Ideas ? Please help.
Thank you very much.
David

GooberDLX
11-07-2003, 04:47 PM
I bet you didnt add it to the Web Service Extensions..

open up the IIS Manager (MMC)..

open your server

go to Web Service Extensions

click Add a new Web service extension

Name it PHPCGI or whatever you want.. and add your php.exe extension.. this will allow it to run in CGI mode (.exe) but it may slow down in performance (big debate on CGI or ISAPI)

restart IIS and it might work! ;)

Gecko24
11-07-2003, 09:25 PM
Thank you... I think is okay but I have now a new message...

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.

Is there my php.ini:

; The directory under which PHP opens the script using /~usernamem used only
; if nonempty.
user_dir =

; Directory in which the loadable extensions (modules) reside.
extension_dir = C:\Inetpub\PHP\extensions

; cgi.force_redirect is necessary to provide security running PHP as a CGI under
; most web servers. Left undefined, PHP turns this on by default. You can
; turn it off here AT YOUR OWN RISK
; **You CAN safely turn this off for IIS, in fact, you MUST.**
cgi.force_redirect = 0

; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape
; (iPlanet) web servers, you MAY need to set an environment variable name that PHP
; will look for to know it is OK to continue execution. Setting this variable MAY
; cause security issues, KNOW WHAT YOU ARE DOING FIRST.
;cgi.redirect_status_env = ;

Do you know that ?
Thanks!
David