Simple hack to get PHP to install on Etch with Apache 2

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

I was 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/" > /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.


One response to “Simple hack to get PHP to install on Etch with Apache 2”

  1. […] worry, this is apparently a known bug. Also, we can thank Darren Beale for finding a very simple solution to this problem. The proceeding fix is a slight variation on his fix, but it ultimately does the exact same […]

Leave a Reply

Your email address will not be published. Required fields are marked *