logo
Published on Technical articles on: Windows servers, Apache Web Server, MySQL, PHP, IIS (http://www.sitebuddy.com)

Apache: Install PHP

By chris
Created 18 Jan 2006 - 3:28pm

Once you have PHP is installed, see: PHP Install
Note: Running PHP as a "DLL" is a lot faster and more secure. It has a few limitations(?) but most apps are built to run with the ISAPI/DLL module.

Add the following to the Apache conf file (httpd.conf):

# For PHP 4 do something like this:
LoadModule php4_module "c:/YOUR_APACHE_BIN_PATH/php4apache2.dll"
AddType application/x-httpd-php .php
# Copy the php4apache2.dll file from the PHP "sapi" directory to your "bin" folder. 
# Most Apache 2.2.x distribution provide their own phpXapache2.dll.

# For PHP 5 do something like this:
LoadModule php5_module "c:/YOUR_APACHE_BIN_PATH/php5apache2.dll"
AddType application/x-httpd-php .php
#Note PHP has released a DLL for Apache 2.2.x.
#You can find this DLL (php5apache2_2.dll) starting with PHP 5.2 (see php daily snapshots)
# Copy the php5apache2.dll file from the PHP "sapi" directory to your "bin" folder. 

# configure the path to php.ini
PHPIniDir "E:/php"

You need a PHP DLL (i.e. phpXapache2.dll) compiled with the headers of the Apache release, you are running.
For Apache distributions downloads see: Apache Binaries and other integrated distributions
For more information about PHP directives see: Php.ini common directives

Most PHP sites, will gain considerable speed by using a PHP accelerator. More information about PHP accelerators, visit: PHP Accelerators

Looks like PHP first tries to load php-apache2handler.ini then defaults to php.ini (details: PHP Install).
This is good to maintain different php.ini's for the different servers (IIS,Apache,CGI..etc..).

Note: When starting the Apache service using a local account, make sure that user ends up having permissions to the PHP folders (c:/php/php5apache2.dll ...etc...).


Source URL:
http://www.sitebuddy.com/Apache/PHP/Install