View Single Post
Old 08-01-2012, 12:38 AM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,662
Thanks: 4
Thanked 2,452 Times in 2,421 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
First you need to load the module. That's done like so:
Code:
LoadModule php5_module "/path/to/php/php5apache2_4.dll"
That path is very specific to the php version and apache build. You'll need to look through and verify it against the version of apache you have (also very specific to the architecture and threading capabilities), and choose the proper version. It's name is: php{major}apache{major}_{minor}.dll/.so.

Next you need to add the type:
Code:
    AddType application/x-httpd-php .php
I usually wrap mine in mod_mime.c check.

Finally if you want it, you can add a directory index. Search for DirectoryIndex and simply add in index.php. These are separated by spaces.

Restart apache for the settings to take affect.
For an example, this is what I've done for 5.4 build:
Code:
<IfDefine PHP_5_4_0>
  LoadModule php5_module "D:/Server/PHP/php-5.4.0/php5apache2_4.dll"
  PHPINIDir "D:/Server/PHP/PHP-5.4.0/"
  <IfModule mod_mime.c>
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps
  </IfModule>
</IfDefine>
That lets me load a module for PHP5, set its directory and add its type.
Fou-Lu is offline   Reply With Quote