16 Jul, 2008
Windows: Installing PHP 5.2.6 on Apache 2.2.9 Manually
This is a continuation from the previous topic Apache on Windows.
Download the latest php-x.y.z-Win32.zip at http://www.php.net/downloads.php .
Unzip the contents of php-5.2.6-Win32.zip package to C:\PHP folder.
Find and rename the file php.ini-recommended to php.ini.
Open the file php.ini, look and uncomment the following directives (Click Edit > Find or Ctrl F). Uncomment – remove the ; before a directive to activate it.
display_errors = on
register_globals = off
magic_quotes_gpc = on
extension_dir = /PHP/ext
session.save_path = /tmp Create a folder named TMP under the root directory (Drive C:)
extension=php_mbstring.dll
extension=php_mysql.dll
Attach PHP to Apache as a module. Open the Apache configuration file (C:\Program Files\Apache Software Foundation\Apache2.2\Conf\httpd.conf).
Search for LoadModule. Add this at the end:
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule php5_module "c:/php/php5apache2_2.dll"
PHPIniDir "C:/PHP"
Search for DirectoryIndex and add index.php .
<IfModule dir_module>
DirectoryIndex index.php index.html
</IfModule>
Add the following under <IfModule mime_module>:
AddType application/x-httpd-php .php
Copy libmysql.dll file from your C:\PHP folder to the C:\WINNT\system32 directory or C:\Windows\System32 directory(Windows XP).
Restart Apache.
To Test PHP
Create phpinfo.php, type:
<?php echo phpinfo(); ?>
Save as phpinfo.php in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\
Open a browser and point to http://localhost/phpinfo.php or http://127.0.0.1/phpinfo.php .



















