View Single Post
Old 08-25-2005, 08:59 AM   #5 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,489
sde is on a distinguished road
Ok, you could try to just install IIS ( as instructed below ) and download the installer version of PHP. It might work, but below is detailed instructions on how to configure everything manually.

If you do choose to do the installer, and something doesn't work, just go down this list and make sure all these settings are configured correctly.

This write-up turned out longer than I anticipated. Should be helpful for someone in the future though.

Prepare PHP

1. Download PHP ( i recommend PHP5 if you don't have any reason to use PHP4 ). Get the Zip package and not the installer.

2. Extract the files to your hard drive to C:\PHP5\ .

3. rename C:\PHP5\php.ini-recommended to php.ini


Configure IIS

1. Install IIS if it hasn't been installed already. start->control panel->add/remove programs->windows components->Internet Information Services (IIS). You will probably need your win2k disk.

2. Open your website properties:
- start->control panel->administration tools->internet information services
- expand the tree on the left till you see Default Website
- Right click on Default Website and left click on Properties

3. Select the home directory tab. Here you can browse to the directory where your web files will be stored.

4. Map your php executable to the .php extension
- Click Configure
- Click Add
- Browse to C:\PHP5\php-cgi.exe
- All verbs and Script Engine Checked
- Press OK and Press OK again.

(we should now be back on the default web site properties page)

5. Setup index.php as a defult page.
-Click Documents
- Click Add
- enter index.php
- Press OK and Press OK again.

6. Restart IIS
- start->run
- type: cmd and press enter.
(you should now see the command prompt)
- type: iisreset and press enter
- close command prompt

.... take a breath, almost there.

Add the PHP path to your PATH environment variable

This step is really optional, but if you don't do it, you need to copy your php.ini file to your C:\WINDOWS ( or WINNT ) directory. I like to keep all my PHP stuff in the same place, so I do it this way.

1. start-> (right click on my computer and left click on properties)
2. Click the Advanced tab.
3. Click the Environment Variables button.
4. in the bottom on System Variables click on Path and click Edit
5. at the end of the variable value add C:\PHP5; (make sure there is a semi colon before your entry and the last path.
6. press OK and press OK again.




Configure Permissions

At this point, the only thing that would prevent PHP from working is the internet user on your local machine not having permissions to access the C:\PHP5 directory. For this next step you need to know the internet user's name on your computer. Usually it's iusr_<COMPUTER NAME>.

1. Open windows explorer. right click start, left click explorer
2. Right Click C:\PHP5 and Left Click Properties
3. Click the Security Tab.
4. Click Add
5. Type in the internet user's name and press OK
6. Click on this user and give them Read & Execute permissions.
7. Press OK.

.. now the fun part. let's test PHP
open your favorite text editor copy/paste this text:
PHP Code:
<?php
phpinfo
();
?>
Save the file as phpinfo.php in your web directory ( remember, from the IIS configuration )

now open your favorite browser and type in: http://localhost/phpinfo.php

If you followed or verified that all the steps I went through are correct, then you should have no problem seeing a nice long page with all the PHP settings.
__________________
Mike
sde is offline   Reply With Quote