Thursday, August 27, 2009

PHP5 with Apache HTTP Server on windows

After PHP5 and Apache server are installed on the windows machine...

add the following towards the end of httpd.conf


#load the php main library
Loadfile "C:/php-5.2.10-Win32/php5ts.dll"

#load the sapi so that apache can use php
LoadModule php5_module "C:/php-5.2.10-Win32/php5apache2_2.dll"

#set the php.ini location
PHPIniDir "C:/php-5.2.10-Win32"

#Hook the php file extensions
AddHandler application/x-httpd-php .php
AddHandler application/x-httpd-php-source .phps


make a copy of php.ini-recommended and rename it to php.ini
restart the http server and test a php page.