Installing PHP5.3.3 on Apache 2.2x (Windows)

List of steps involved in getting PHP5 to work with a pre-installed Apache server on Windows.

  1. Download the file “php-5.3.3-Win32-VC6-x86.zip” from “http://windows.php.net/download/”
  2. Extract contents of this file to C:/PHP/
  3. Copy C:/PHP/php.ini.development to a new file  php.ini in the same folder
  4. In the httpd.conf file of Apache, add the following lines after the LoadModule block.
    LoadModule php5_module "C:/PHP/php5apache2_2.dll"
    AddHandler application/x-httpd-php .php<
    # configure the path to php.ini
    PHPIniDir "C:/PHP"
  5. Restart Apache.

Thats it ! PHP pages should now be processed and displayed by apache. To test, create a file PHPTest.php in folder “[Apache-root]/htdocs/” with following content.


<?php
phpinfo();
?>;

In the browser open the URL “http://localhost/PHPTest.php”. This should now display the PHP engine details.

Now, as required the document root, extensions folder, available extension etc for PHP can be configured in the file C:/PHP/php.ini.

Sreekumar Kj
Sreekumar (KJ) has been a hobby programmer from school days. Codemarvels is his personal blog from the year 2010, where he writes about technology, philosophy, society and a bit about physics. He now runs a conversational AI company - DheeYantra - focusing his efforts to help businesses improve operational efficiency using digital employees powered by AI.