How to install PHP 5.x on Windows Server 2003 with IIS 6
http://www.peterguy.com/php/install_IIS6.html A detailed and hopefully helpful step-by-step guide, based on my experience.
Last updated 8:27 PM 11/29/2005
questions/props/corrections/etc... >
http://php.net.
Unzip it somewhere on your hard drive.
You can pick any drive, and any folder, but the recommendation is to put all the PHP stuff in a folder just off of the root drive (avoid whitespace), like C:\PHP, and this guide will follow that recommendation.
Download the "Collection of PECL modules for PHP 5.0.3" zip file and extract the contents of that file into C:\PHP\ext. It contains more extensions.
1.2 Rename/copy php.ini-recommended to php.ini
In your PHP directory, you'll find a couple of php.ini-* files. They are pre-configured settings for a PHP install that you can use as an initial setup. php.ini-recommended is the most secure, hence, the recommended one; just rename it to php.ini.
2.
http://www.garykeith.com/browsers/downloads.asp to the extras directory under your PHP install directory (C:\PHP\extras\browscap.ini, for example), and change the
browscap
variable in php.ini to be the full path to the file (
browscap=C:\PHP\extras\browscap.ini
).
2.3 Create a session state directory and point the
session.save_path
php.ini variable to it.
This is another optional but recommended step. PHP does not
need sessions, but it's something that will most likely be useful.
Create a session directory somewhere on the server. I created C:\PHP\Sessions. This directory will hold many small files with session variable information for PHP. They probably won't take up a whole lot of room, but if you need to keep your data off your system drive, then you can put the folder anywhere else.
Now change the value of the
session.save_path
variable in php.ini to be the full path to that directory (
session.save_path=C:\PHP\Sessions
).
2.4 Setup the PHP extensions.
If you want to install extensions (For information on extensions, visit
http://ca3.php.net/manual/en/instal...nsions.php), then you need to go through a couple of steps.
You need to point PHP to the directory that holds the extension libraries, you need to rearrange the list of extensions so that they'll load w/out throwing errors, and you need to uncomment the desired extensions.
- Point PHP to the correct directory:
Set
extension_dir
in php.ini to "C:\PHP\ext"
- Massage the list of extensions so that most of them will load w/out throwing errors.
The easiest thing to do is replace all the "extension=" lines in php.ini with the following (be sure to scroll down so you get everything):
- Uncomment the ones you want to use.
Some notes on using extensions:
- I left uncommented all the ones that I got to work on my system with no additional software.
- If you have not downloaded and extracted the "Collection of PECL modules for PHP 5.0.3" archive, not all of the uncommented ones will work.
- Most of the ones that won't load rely on other software being present, like oracle, informix and sybase.
- php_mcrypt.dll requires the mcrypt library, the source code for which can be found http://www.visualwin.com/PHP/ for quite a few pictures detailing the process.
That is actually the website I used the most when figuring this all out.
I know, this isn't really a troubleshooting tip, but I don't have anywhere else to put it now.
5.7 I'm installing on a 64-bit box and all I get is a 500 error page!
This just in, from Ryan Hubbard:
On 64 bit IIS loads all extensions in 64 bit mode by default. Since php5isapi.dll is 32 it freaks out but doesn’t give an errors just a 500 error on php pages. So in order to get it to work on IIS 6 64-bit you need to run the following at the command line.
cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1
This enables both 64 and 32 bit extensions.
<!-- Footer -->
Many thanks to: Andrew Champion (remove "YourPants" to e-mail) for providing the extension ordering tip, kickstarting me toward HTML-formatted goodness, and helping me test parts of this guide.
Cody of
http://apparitiondesigns.com/">
apparition.Designs for expanding on a couple of steps, providing the major framework for this HTML-formatted guide and helping me test several steps.
http://dossett.org/">
Doug Dossett for providing the Application Pool user permission tip
Rob Smith (remove "TheRoadBlock" to e-mail) for providing the tip on checking the loading of extensions via RDC.
All those out there who posted instructions, answered questions, and generally helped me along the path to PHP knowledge (not to imply that I've gotten there yet :-P ).