Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
PHP 5.3.3 using IIS 7.0 on Vista SP2 Desktop
Message
Information générale
Forum:
Open Source
Catégorie:
PHP
Titre:
PHP 5.3.3 using IIS 7.0 on Vista SP2 Desktop
Divers
Thread ID:
01474097
Message ID:
01474097
Vues:
147
Cecil’s steps for setting up PHP 5 on a Vista SP2 Desktop using IIS 7.0

Files to download from: http://windows.php.net/download/
• php-5.3.3-nts-Win32-VC9-x86.msi
• php-5.3.3-nts-Win32-VC9-x86.zip
• php-debug-pack-5.3.3-nts-Win32-VC9-x86.zip

Make a folder on drive C:\ called PHP.

Copy the first two files above to the folder C:\PHP.

Execute the PHP installer file, php-5.3.3-nts-Win32-VC9-x86.msi, by double-clicking on it in the folder C:\PHP.

A dialog box will open for the Installer. Click on the Run button.

You will see a dialog box that says “Preparing to install…” and then the following:

Welcome to the PHP 5.3.3 Setup Wizard. Click on the Wizard's Next button.

The PHP 5.3.3 End-User License Agreement will appear. Check the box that says, “I accept the terms in the License Agreement” and then click on the Next button.

PHP Destination Folder: Change the default from “C:\Program Files\PHP\” to “C:\PHP5\”. Once the change has been made, click on the Next button.

Web Server Setup: Choose the “IIS FastCGI” web server and then click on the Next button.

Choose Items to Install: (Accept the defaults)
Ready to Install PHP 5.3.3: (Click on the Next button.)
Installing PHP 5.3.3:

Setup Completion Screen:

We will need to alter the PHP.INI file which is currently in the C:\PHP5 folder. Open the PHP.INI file with Notepad.

We will do some modifications to this file. You may use CTRL + F to find the strings for the settings:
Find fastcgi.impersonate and set its value to 1. In my case, the value was already set to 1. All I had to do was to remove the semi-colon on the left.

Find cgi.fix_pathinfo and set its value to 1. Remove the semi-colon to turn on this setting.
Find cgi.force_redirect and set its value to.
Find open_basedir and set its value to “C:\Inetpub”.
Find extension_dir and set its value to: “extension_dir=C:\PHP5\Ext”
Find extension doc_root and set its value to “doc_root = "C:\inetpub\wwwroot"/

Close the PHP.INI file and copy it from C:\PHP5 to C:\Windows.

1. Open a command prompt.
2. Navigate to the directory you installed PHP to.
3. Type in: PHP –info and you should see a lot of scrolling and information. This means PHP is good to go.
Below is the start of the command and output, then the second picture is the last thing that will be shown.

You have now properly installed and tested PHP on the server. Now we have to configure IIS 7 to use PHP through FastCGI.
Open IIS 7.0 Manager:

Handler Mappings:

Click on the IIS Server, and then double click on the Handler Mappings icon, or click on the link that states " Add Module Mapping "on the right:

Fill out the following information and click OK:
Request Path: *.php
Module: FastCgiModule
Executable: C:\PHP5\\php-cgi.exe
Name: PHP_via_FastCGI

You will get a popup asking if you want to create a FastCGI application, go ahead and click Yes.

You will now see your enabled handler (for FastCGI) in the Handler Mappings list.

You may now close the IIS 7 Manager.
Now, reboot your computer.
System will not work! I could not render a PHP web page, period. Back to the drawing board! 404.3 Error. This is nothing new!

==============In order to make this work, I had to do the following====================

VERY IMPORTANT ADDITION!!!
The rendering of a PHP page would not work, so I searched around to see if there was any more information I might have missed and found something about putting in a Handler Map at the default web site level within IIS 7.0.
What was needed was to Add a Handler Map at the Default Web Site Level.

In order to add that Handler Mapping, click on the Tree-link called “Default Web Site” and then double-click on “Handler Mappings” in the IIS Manager, circled by a red line above.

The Edit Script Map dialog comes up. Enter the data as you see it below:

If you have the php-cgi.exe file in a different path, then use that path in the executable block above.
Request Path: *.php
Executable: C:\PHP5\php-cgi.exe
Name: PHP_CGI
And then press the OK button. 

I stopped the IIS Server and then restarted it. I then opened an Internet Explorer Browser and typed in:
http://localhost/index.php

and the result was: SUCCESS!!!

Here’s the clue from Gary Davis, dated 11 October 2008:

Gary says:
“I then re-added the Handler Mappings at the web site level (Default Web Site) since it did not show up there even though it was mapped at the server level.”

Thanks to Gary, my efforts to render a PHP page from within the IIS 7.0 Server have finally come to pass. It has only taken me 3 or 4 days of constant effort and searching all over the Internet for one smart person, but I found two, Gary Davis and Dave Lawlor.

Reference Dave’s posting: IIS 7: Install FastCGI & PHP on Server 2008, http://www.trainsignaltraining.com/iis-7-install-fastcgi-php/2008-09-04/

Although my system is a Vista Business Desktop, Service Pack 2, everything worked as Dave Lawlor and Gary Davis suggested, although with a slight bit of difference in the IIS 7.0 setup since Server 2008's looks much different. For example, there were no Server Roles..

Cecil T. Champenois, Jr.
Répondre
Fil
Voir

Click here to load this message in the networking platform