Apache "LoadModule" configuration problem

Im trying to configure apache 2.2.4 so that it will work with PHP.

This is what i typed at the very bottom of the configuration file.

LoadModule php5_module c: /php/php5apache2.dll
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

This is the error message that was returned when I used the function that tests the configuration file (Line 486 is the line that starts “LoadModule…”).

httpd.exe: Syntax error on line 486 of C:/Program Files/Apache Software Foundation/Apache2.2/conf/httpd.conf: LoadModule takes two arguments, a module and the name of a shared object file to load from

I’m pretty sure the solution is easy but i can’t see it. Can anyone help please?

1 Like

I can clearly guess that you are using Windows OS. Can you please tell me which version of Windows you are using so that I can check it accordingly and help you out if I can.


The error message is telling you the problem, though it isn’t always obvious. The problem is most likely the space after c: on the first line. It’s effectively splitting the path parameter into 2 parameters … meaning that apache thinks you are trying to pass three parameters to the loadmodule command.

Change this:

LoadModule php5_module c: /php/php5apache2.dll

…to this:

LoadModule php5_module c:/php/php5apache2.dll

…and it should fix the problem.

Can I just say a massive ‘big up’ to both of you guys! I’ve never used a forum before and I’m stunned at how quickly and willing you were to answer my question.

Teckyhead, you had it down with removing the extra space. Thank a million.

Oh no! I spoke to soon. I accidently amended a back-up config file i made following teckyhead’s solution and this made me think the problem was fixed. However, when I implemented the amendments on the actual config file i got the same error message.

Hostabove, I’m using windows XP Home edition, version 2002, service pack two.

Any other thoughts? :slight_smile:

pasting this line seemed to get apache working.

LoadModule php5_module c:/PHP/php5apache2_2_filter.dll

Thanks again teckyhead and hostabove.