Activities

October 2009
M T W T F S S
« Aug   Nov »
 1234
567891011
12131415161718
19202122232425
262728293031  

At least one `LoadModule’ directive already has to exist’ PHp installation error

I was stuck for a few mins just now when trying to do a ‘make install’ for php 5.2.1.

I am getting the following error:

apxs:Error: Activation failed for custom /etc/apache2/httpd.conf file..
apxs:Error: At least one `LoadModule’ directive already has to exist..
make: *** [install-sapi] Error 1

As you can see the assumption is that Apache’s httpd.conf contains at least one LoadModule directive. This is reasonable for Apache 1.3 but with the latest stable Debian Apache 2 package (which I’ve avoided using for far too long) there is a new fangled layout where httpd.conf has been sidelined (it is there but 0 bytes) in favour of a nice and logically organised config file system. I’m not sure if this is standard or the ‘debain way’ but it’s what I’ve got to work with.

Whatever, the fix is easy: simply trick the php build script that there is a directive there. It’s also commented out so we don’t annoy Apache next time we restart:

echo " #LoadModule foo_module /usr/lib/apache2/modules/foo.so” > /etc/apache2/httpd.conf

(the line break after the opening quote is important so we get a blank line in the file).

Works for me.


Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>