mod_fastcgi安装错误

我已经成功编译了Apache 2.4.2,但在编译mod_fastcgi模块时遇到了错误。

有小费吗?

root@local:/usr/src/libapache-mod-fastcgi# /usr/local/apache2/bin/apxs -o mod_fastcgi.so -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 . root@local:/usr/src/libapache-mod-fastcgi# 

据我记得,mod_fastcgi和Apache 2.4有一些错误。 刚刚检查版本2.2,它完美编译。 现在找不到错误报告。

几乎可以肯定,这是由于Apache在v2.4.x中将unixd_config api名称更改为ap_unixd_config

http://httpd.apache.org/docs/2.4/developer/new_api_2_4.html

我一直在争取这个试图让它与mod_fastcgi 2.4工作,我甚至尝试编辑fcgi.h(唯一的引用unixd_config我可以find在mod_fastcgi源文件)添加

 #define unixd_config ap_unixd_config 

或以其他方式重命名所有对unixd_config的引用,但这些都不起作用。

我开始怀疑在apr / apr-devel包中是否也有一些对unixd_config的引用,因为它们需要编译mod_fastcgi,而且我必须find一个更新的版本(我相信1.4.6,因为yum安装了旧的1.3 .9),并将它们放到apache 2.4.3源代码的srclib文件夹中,以便它无错地编译(如下所示: http : //www.thegeekstuff.com/2012/05/install-apache-2- on-centos-6 / )

这真是令人沮丧,因为我想要apache 2.4,但不想运行php作为mod_php,但使用mod_proxy_fcgi与PHP fpm的“新&改进”的方法有各种各样的问题,如不想玩好别名:(

你有没有尝试这个补丁mod_fastcgi

我在这个链接中find了答案: http : //leeon.me/a/apache-2.4-install-mod_fastcgi (我是西class牙语演讲者,我确实需要“阅读”中文)

你可以执行下一步,做想要的(validation你的path,我正在使用RPM布局):

 time (wget 'http://www.fastcgi.com/dist/mod_fastcgi-SNAP-0910052141.tar.gz' && tar -zxvf mod_fastcgi-SNAP-0910052141.tar.gz && cd mod_fastcgi-SNAP-0910052141 && cp Makefile.AP2 Makefile && wget http://leeon.me/upload/other/byte-compile-against-apache24.diff && patch -p1 < byte-compile-against-apache24.diff && make top_dir=/usr/lib/httpd/ && make install top_dir=/usr/lib/httpd/) 

手动…

 nano /etc/httpd/conf/httpd.conf/httpd.conf LoadModule fastcgi_module lib/httpd/modules/mod_fastcgi.so 

您没有安装所有的依赖项。

尝试检查安装在/ usr / local / apache2 / bin /中的libtool并安装在您的系统中,它们可能具有不同的冲突版本。

没有理由使用这个不受支持的第三方模块。

使用apache提供的mod_fcgid或新的mod_proxy_fcgi模块。