Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've compiled Apache 2.4.2 successfully, but I'm facing an error while trying to compile mod_fastcgi module.

Any tips?

root@local:/usr/src/libapache-mod-fastcgi# /usr/local/apache2/bin/apxs -o -c *.c
/usr/local/apr/build-1/libtool --silent --mode=compile gcc -std=gnu99 -prefer-pic   -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -g -O2 -pthread -I/usr/local/apache2/include  -I/usr/local/apr/include/apr-1   -I/usr/local/apr/include/apr-1   -c -o fcgi_buf.lo fcgi_buf.c && touch fcgi_buf.slo
/usr/local/apr/build-1/libtool --silent --mode=compile gcc -std=gnu99 -prefer-pic   -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -g -O2 -pthread -I/usr/local/apache2/include  -I/usr/local/apr/include/apr-1   -I/usr/local/apr/include/apr-1   -c -o fcgi_config.lo fcgi_config.c && touch fcgi_config.slo
fcgi_config.c: In function 'fcgi_config_set_fcgi_uid_n_gid':
fcgi_config.c:241: error: 'unixd_config' undeclared (first use in this function)
fcgi_config.c:241: error: (Each undeclared identifier is reported only once
fcgi_config.c:241: error: for each function it appears in.)
fcgi_config.c: In function 'fcgi_config_make_dir':
fcgi_config.c:345: error: 'unixd_config' undeclared (first use in this function)
fcgi_config.c: In function 'fcgi_config_new_static_server':
fcgi_config.c:782: warning: initialization from incompatible pointer type
fcgi_config.c:782: error: expected expression before ')' token
fcgi_config.c:782: warning: passing argument 5 of 'ap_log_error_' makes integer from pointer without a cast
/usr/local/apache2/include/http_log.h:372: note: expected 'apr_status_t' but argument is of type 'struct server_rec *'
fcgi_config.c: In function 'fcgi_config_new_external_server':
fcgi_config.c:975: warning: initialization from incompatible pointer type
fcgi_config.c:975: error: expected expression before ')' token
fcgi_config.c:975: warning: passing argument 5 of 'ap_log_error_' makes integer from pointer without a cast
/usr/local/apache2/include/http_log.h:372: note: expected 'apr_status_t' but argument is of type 'struct server_rec *'
apxs:Error: Command failed with rc=65536
share|improve this question
up vote 1 down vote accepted

As far I remember there was some kind of error with mod_fastcgi and Apache 2.4. Just checked version 2.2 and it compiles perfectly. Can't find a bug report now.

share|improve this answer

almost certain it's due to Apache changing the unixd_config api name to ap_unixd_config in v2.4.x

I've been fighting this trying to get it 2.4 working with mod_fastcgi, I even tried editing fcgi.h (the only references to unixd_config I could find in the mod_fastcgi source files) to add

#define unixd_config ap_unixd_config

or otherwise rename all references to unixd_config, but neither of those worked.

I'm starting to wonder if there might also be some references to unixd_config in apr / apr-devel packages since they are required to compile mod_fastcgi, and I had to find a newer version (1.4.6 I believe, as yum installs old 1.3.9), and place them into the srclib folder of apache 2.4.3 source in order for it to compile without errors (like shown here:

This is really frustrating because I want apache 2.4 but do not want to run php as mod_php but the "new & improved" method using mod_proxy_fcgi with php fpm has all sorts of issues like not wanting to play nice with aliases :(

share|improve this answer

I found the answer in this link: (I'm speaker spanish, I did need to "read" Chinese")

You can execute the next, to do the wanted (verify your paths, I'm using RPM layout):

time (wget '' &&
tar -zxvf mod_fastcgi-SNAP-0910052141.tar.gz &&
cd mod_fastcgi-SNAP-0910052141 &&
cp Makefile.AP2 Makefile &&
wget &&
patch -p1 < byte-compile-against-apache24.diff &&
make top_dir=/usr/lib/httpd/ && make install top_dir=/usr/lib/httpd/)

Manual ...

nano /etc/httpd/conf/httpd.conf/httpd.conf
LoadModule fastcgi_module lib/httpd/modules/
share|improve this answer

You don't have all the dependencies installed.

share|improve this answer
That's what I think it may be. Any thoughts? APR installed, apr-utils installed, Apache installed - no clue. – Jari V. Aug 20 '12 at 18:06
do you have the apache headers in your include path? – Christopher Perrin Aug 20 '12 at 18:15
Trying Googling for that. Do you have a link about headers in linux, include path and how to add them into? – Jari V. Aug 20 '12 at 18:47

Try checking libtool installed in /usr/local/apache2/bin/ and installed in you system, they may be of different conflicting versions.

share|improve this answer

There is seriously no reason to use this unsupported, 3rd-party module.

Either use the apache-provided mod_fcgid, or the new mod_proxy_fcgi module.

share|improve this answer
mod_fcgid gives the same unixd_config error as mod_fastcgi 2.4 :( – WebChemist Aug 31 '12 at 1:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.