win32 F/OSS development - PHP Install

After Apache is up and running, it's time to install PHP.

First, grab the PHP binary. Currently (July 2006) PHP is at version 5.1.4... This version is not playing nice with Apache 2.2.2. Head over to the PHP Snapshots site and grab one of the Stable (5.2.x-dev) versions. We'll drop the zip file in our C:\WWW\PHP\ folder.




To extract the zip file we'll open a command prompt, browse to the folder C:\WWW\PHP\ and execute:
     7z  x  <ourZipName>




You can now delete the zip file. Rename php.ini-recommended to php.ini. You'll also need to make some changes to the defaults as follows:

short_open_tag = On
display_errors = On
display_startup_errors = On
doc_root = C:/www/webroot/
extension_dir = C:/www/PHP/ext/
extension=php_mbstring.dll
extension=php_bz2.dll
extension=php_gd2.dll
extension=php_mcrypt.dll
extension=php_mysql.dll
extension=php_openssl.dll
session.save_path = "/www/tmp"

My php.ini file is here.




Last up is to tell Apache to load up php. Open up c:\www\apache\conf\httpd.conf
Under the 'Load Modules' bit add the lines:

LoadModule php5_module "/www/PHP/php5apache2_2.dll"
PHPIniDir "/www/PHP/"

And modify the line:

<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>

to be:

<IfModule dir_module>
    DirectoryIndex index.html index.php
</IfModule>

Then in the section <IfModule mime_module> add the following under the other 'Addtype' lines:

AddType application/x-httpd-php .php .html

My httpd.config at this point is here.




Restart the Apache service.
To test the PHP install, we'll call the phpinfo() function. Save this into c:\www\webroot\. Rename it to: phpinfo.php Point your browser to http://127.0.0.1:8080/phpinfo.php to verify php is installed.






Next >>