Installing PHP 5 in Windows
by Rekha[ Edit ] 2010-03-17 18:45:57
* Download and install PHP from http://www.php.net/downloads.php, you should grab the newest 5.x.x Windows Binaries zip package that will work on apache.
* Unzip php. Rename it as php and save it in D:Program Files/
* In php folder you have a file named php.ini-dist.Copy the file and save it in D:/WINDOWS/and rename it to php.ini
*Edit your php.ini.Open php.ini in a text editor and scroll down about halfway through the file and look for extension_dir. and change the extension_dir from extension_dir = "./" to the location of the ext directory after you unzipped PHP say extension_dir = "D:Program Filesphpext"
* Uncomment any extensions you are going to use. For example:
extension=php_curl.dll
extension=php_gd2.dll
extension=php_mysql.dll
* Copy the libmysql.dll and save it in D:/WINDOWS/system32/.Without this file php_mysql.dll won't work.
* Edit Apache Conf File.Using Notepad open httpd.conf and add the following lines at the end.
LoadModule php5_module "D:/Program Files/php/php5apache2_2.dll"
AddType application/x-httpd-php .php
* Then Restart Apache.
To test your PHP simply create a test.php file in your Apache "DocumentRoot" folder. In your test.php file, type these 3 lines and then load the file in your browser like http://localhost/test.php (you should get a whole long list of php variables, settings, etc):
<?php
phpinfo();
?>