Configuring Apache 2.2 with PHP 5.x on Windows 8

4.5k Views Asked by At

I have Windows 8 64 bit, I downloaded Apache 2.2 and PHP 5.53 Thread Safe and put them in "D:/Server" folder.

D:\Server\Apache2

D:\Server\php

I copied the file "php.ini-production" in D:\Server\php and named it php.ini ; The file php5apache2_4.dll exist in D:/Server/php

Then I edit "D:\Server\Apache2\conf\httpd.txt":

...
LoadModule php5_module "D:/Server/php/php5apache2_4.dll"
...
AddType application/x-httpd-php .php
...
PHPIniDir "D:/Server/php"

Then I try to restart Apache 2.2 but it pop up en Error window: "The requested operation has failed" (If I omit the first and the thirs declerations, it does restart...)

I also tried PHP 5.2.17 that has php5apache2_2.dll file, and it doesn't work..

Thanks for your help!

1

There are 1 best solutions below

0
On

Use AddHandler instead of AddType... Also, windows-style slashes work fine for paths.

E.g. my httpd.conf contains following:

PHPIniDir "C:\php\"
LoadModule php5_module "C:\php\php5apache2_4.dll"
AddHandler application/x-httpd-php .php