Installing php on vista (And configure APACHE)
October 10th, 2008Apache installation on Vista is a breeze. Just use the installer downloaded from http://httpd.apache.org/download.cgi.
If you are looking steps to install PHP using MSI Installer, this isn’t for you. I have tried installing PHP using MSI installer on Vista, and it was a pain. So I decided to manually install and setup the PHP environments.
Below are the steps:
- Download PHP Windows Binaries from http://www.php.net/downloads.php#v5 (zip package).
- Unzip them to your desired location. I recommend not to install PHP on the partition where your Vista resides (e.g. D:\PHP) to avoid UAC annoyance.
- Click on “Vista” icon (or “Start” button) on your desktop, right click on Computer and select Properties. Click on Advanced system settings.
- A dialog box pops up. Click on Environment Variables.
- Under System Variables scroll to find Path variable. Select and click Edit…
- Append your PHP path (e.g. D:\PHP) to the beginning of Variable value. Don’t forget to insert ; after it. And save it.
- Under System Variables click New…
- Variable name: PHPRC, Variable Value: D:\PHP. And save it.
- And just click OK buttons all the way to close all the dialog boxes.
- Open a Command Prompt and execute “php -v” to see if PHP is correctly installed.
- Edit php.ini file (under D:\PHP) and set your extension_dir to “./ext”.
- Edit httpd.conf (Apache’s) and add
LoadModule php5_module “D:/PHP/php5apache2_2.dll”
AddType application/x-httpd-php .php
line to the bottom of the file.