Apache won't load PHP module

My Apache runs fine and I can pull up the static webpage.

PHP runs fine, and I can hit the command line with php -v and get the version information.

I can even insert the AddType lines to my httpd.conf file. However, as soon as I try to load the module…

LoadModule php5_module “C:\Program Files\PHP\php5apache2_2.dll”

Apache throws an error in a message window “The requested operation failed!”

If I comment the line out, Apache runs fine again but won’t process the PHP in my .php files. I’ve tried all kinds of recommendations including using backslashes in the path, forward slashes in the path, quotes around the path, no quotes.

I’m using the VC6 thread safe installation, and I’ve confirmed that the .dll is inside that directory. I installed Apache normally and that went fine. I extracted the PHP .zip file into C:\Program Files\PHP and copied the development version to my php.ini file.

What am I getting wrong?

Is Apache writing to its error log file?

Have you tried putting the DLL in the same directory as the rest of the modules and not using a full path?

My problem is fixed and I’ve no real idea why. I rebooted several times while I was working on it but maybe it just needed a good nights sleep.

It could also be that I uninstalled the VC9 version late last night and installed the VC6 Thread Safe since I’m running it under the Apache Modules. It may be that something I tried this morning while testing the error log was something I’d tried a million times, but not since I installed VC6. Not sure what it would be.

Moving the DLL was something I hadn’t tried yet, and did not get around to. Nor did the error log have anything really useful because the PHP directives would not pick up except when Apache started or restarted. And on starting the service it would throw an error before getting far enough to write anything to the error log.

Anyway at least it’s working. :slight_smile: Thanks Dan!

Here’s the final setup which worked. I know I tried this earlier in the day when I still had the VC9 Thread Safe installed so that was definitely one problem. I now have the VC6 Thread Safe files for PHP 5.3.1 which I unzipped to my PHP directory.


#Tell Apache to process files with the following extensions
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps

# Configure Apache to process PHP
LoadModule php5_module "C:\\Program Files\\PHP\\php5apache2_2.dll"
PHPIniDir "C:\\Program Files\\PHP"