Saturday, September 24, 2011

Configuring Apache HTTP Server for PHP

First install Apache HTTP Server and then install PHP.

Next you must edit the httpd.conf file located in the conf directory of your Apache Install Directory. Add the follow lines to the end of the file (the lines may already exist; if so then verify they are correct and make any required changes):

#BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
PHPIniDir "<PHP_INSTALL_DIRECTORY>"
LoadModule php5_module "<PHP_INSTALL_DIRECTORY>\php5apache2_2.dll"
<FilesMatch \.php$>
 SetHandler application/x-httpd-php
</FilesMatch>
#END PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL

Replace the placeholder for the PHP Install Directory with a valid value and restart the Apache server. This example is specific to Apache 2.2 installed on Windows, so you may need to make slight tweaks if using a different version or operating system. See the following link for more information:

http://www.php.net/manual/en/install.php

No comments:

Post a Comment