Installing PHP to run on Windows through IIS is pretty simple because there is an installation wizard that does everything for you. But, those of us who also have Apache running for development need to have Apache process PHP pages too. This is a walkthrough to get both running.
This will run PHP in CGI mode for both IIS and Apache.
1. Download from www.php.net the Windows Installer version of PHP AND the Windows “manual install” .zip distribution. (If you already have PHP running for IIS, then you only need the zip version)
2. Run the PHP installer. Install it to its default location of C:\PHP. PHP should now be working with IIS.
3. Move the file C:\PHP\php.ini-dist to C:\Windows\php.ini
3. Unzip the “manual install” distribution. You’ll notice that it has much of the same files as are already in C:\PHP. Move all the of extra directories contained in this .zip to C:\PHP
4. Download and install Apache HTTP server from www.apache.org. (I used version 2). Default install location is C:\Program Files\Apache Group\Apache2. The configuration you use is up to you, but i specify in the install wizard to run Apache manually on port 8080 so that it will co-exist with IIS (which is already on port 80). Then after that is done, I install it as a service by executing the command-line command: apache -k install
(from within the apache2\bin directory)
5. Edit the Apache configuration file C:\Program Files\Apache Group\Apache2\httpd.conf – make the following changes:
# search for “DirectoryIndex” and add index.php to the end:
DirectoryIndex index.html index.html.var index.php
# search for “ScriptAlias” and add the following lines in that section:
ScriptAlias /php/ “c:/php/”
AddType application/x-httpd-php .php
Action application/x-httpd-php “/php/php.exe”
6. restart Apache and the new configuration should take effect. create a test PHP file and see how it works.
* caveat: if you use the same browser and surf back-and-forth between IIS and Apache, you may get a bunch of weird error messages about permission denied while writing session files. This is because Apache and IIS run as different users & they will block each other from writing to the same session file.
what about iis services such as ftp coexisting with apache ones… wich ftp service will windows take on an ftp program for example?
hey sol, you can run multiple ftp services (iis and apache) at the same time, but only one of them can be configured to listen on the default port 21. So you could run apache ftp on another port, for example port 2121. Then if you want to connect to apache you would have to include the port in the host for example: server.com:2121
Thanx for your quick answer. I have already IIS running but got only problem between Dreamweaver and MySQL, takes too long to read the database, though i got no problem loading the data with other tools such as phpmyadmin or through php on browsers… i was thinkin on installing apache too but im tryin to solve sole the problem first instead of having two servers and using the double of resources (sorry my english).