mod_php5.c:22: php_apache_http.h: No such file or directory

Posted by Streetdaddy™ on July 31st, 2008 filed in Geek

Whilst it may seem nonsensical to you, the title of this post could save someone else the headaches I had, but only if that someone is trying to compile apache v1.3.x with support for php5. So there’s this old server at my work that’s just been chugging away for years (since well before I started) and supposedly nobody has been game to touch it, until I came along and decided to try and get mod_deflate working.  The seemingly simple task of recompiling apache came to a grinding halt with this failure:

mod_php5.c:22: php_apache_http.h: No such file or directory


1.3.33 is almost 3 years old now, and after trawling endless mailing lists and way to many./configure attempts, I gave up for long enough to make a late afternoon coffee, read a few inspiring quotes, and kept trying… Eventually I managed to get it to compile and render PHP pages with the following:

./configure \
--activate-module=src/modules/php5<strong>/libphp5.a</strong> \
<add your switches here>


The clincher was adding the correct source file reference, as I’d previously tried ‘src/modules/php5/libmodphp5.a’, or just ‘src/modules/php5’, none of which worked.  If you found this helpful please let me know, because until then this is just 5 minutes of my life wasted…

Leave a Comment

FireStats icon Powered by FireStats