Setting up apache and php in vista
From Neural Wiki
I just purchased my copy of PHP Hacks by Jack Herrington, and wanted to try out some of the projects in an environment where I could use a command prompt (I cant do this on my hosted websites). I naively figured that I could simply install Apache and PHP easily onto my Vista laptop in the manner explained in the book. Vista had other plans. After 5 ridiculously long and painful hours I was finally able to install an Apache 2.0 webserver and PHP 5.0 onto my Vista machine. I am detailing the steps in order to hopefully save other people this massive headache.
[edit] TURN OFF USER CONTROL!!!
This one simple step will save you the previously mentioned massive headache. For some reason Microsoft decided that instead of the normally annoying (but understandable) process whereby you approve operations, when it comes to letting one program modify files in another program it would simply do nothing. It won't even ask if you want to modify another program so that the two will work together as they were designed to. There is no error message, and it appears that everything has worked just fine. That is until you go to try and work with the programs.
To turn off user controls: Go to Start->Control Panel, then click on User accounts and family safety (red arrow in Fig 1)
Next click on User Accounts (blue arrow)
Then click Turn User Control Account control on or off (green arrow)
Then uncheck the box. You will have to restart after this, but once you do you can start installing the programs.
[edit] Install Apache
I chose to install Apache 2.0.63 from the Apache Download site. What you want is the file that ends with .msi, so it will self install. The file I downloaded was called apache_2.0.63-win32-x86-openssl-0.9.7m.msi.
Once downloaded, just double click on the icon and it will ask you a few questions before installing. I didn't change the default installation directory, so it installed in c:/Program Files/Apache Group/Apache2.
Now to check if it works. Apache will probably start on its own, but in order to find out, open up your web browser and type in http://localhost and if it is running you will see something that looks like
If it doesn't work, open your command prompt and go to c:/Program Files/Apache Group/Apache2/bin and type in Apache. Then try refreshing your browser. If you get some kind of strange error at the command prompt, it is probably because some other program is running on port 80. You will have to figure that one out yourself.
[edit] Install PHP
I downloaded the PHP 5.2.5 Windows installer (called PHP 5.2.5 Installer). The PHP installer is very nice, and does all the work for you. Just double click on it, and go through the setup process. It will ask you if you want to set up a server, and you will want to click on the Apache 2.x when you see the screen below. If you install a different version of Apache, then just click the appropriate button.
You will have to tell PHP where the file httpd.conf is located in Apache. For me it was c:/Program Files/Apache Group/Apache2/conf
A few screens later it will ask if you want to install any extensions or extras. I chose to install SOAP and MYSQL in extensions and PEAR in extras. These did not cause a problem with my install, and it will set everything up so that you can use MYSQL and SOAP and PEAR without having to edit files.
Then finally go ahead and install. The PHP installer will modify your httpd.conf file for you, which is nice. With Vista's nanny on, it will not edit this file and throws a fit when you try to modify it yourself.
Then you should make a php page that you save in the Apache2/htdocs folder. Save the file as test.php and put this in it
test.php <?php phpinfo() ?>
Then open your web browser and type in http://localhost/test.php and you should get a page that looks like
Now you are done and have a nice platform from which to play with PHP.

