安装FastCgi错误( In function `init_module': ) 解决办法

啥也不多说,直接帖错误代码如下:

mod_fastcgi.c: In function `init_module':
mod_fastcgi.c:271: `ap_null_cleanup' undeclared (first use in this function)
mod_fastcgi.c:271: (Each undeclared identifier is reported only once
mod_fastcgi.c:271: for each function it appears in.)
mod_fastcgi.c: In function `process_headers':
mod_fastcgi.c:726: warning: return makes pointer from integer without a cast
mod_fastcgi.c:730: warning: assignment makes pointer from integer without a cast
mod_fastcgi.c:740: warning: assignment makes pointer from integer without a cast
mod_fastcgi.c:769: warning: initialization makes pointer from integer without a cast
mod_fastcgi.c:839: warning: return makes pointer from integer without a cast
mod_fastcgi.c:843: warning: return makes pointer from integer without a cast
mod_fastcgi.c: In function `set_uid_n_gid':


 

在网上搜索到一篇帖子的解决办法是:建立一个patch文件,但是按照他的源码帖进去后,还是不行.他的代码如下:

 

@@ -73,6 +73,36 @@
#define ap_reset_timeout(a)
#define ap_unblock_alarms()

+/* starting with apache 2.2 the backward-compatibility defines for
+ * 1.3 APIs are not available anymore. Define them ourselves here.
+ */
+#ifndef ap_copy_table
+
+#define ap_copy_table apr_table_copy
+#define ap_cpystrn apr_cpystrn
@@ -73,6 +73,36 @@
#define ap_reset_timeout(a)
#define ap_unblock_alarms()

+/* starting with apache 2.2 the backward-compatibility defines for
+ * 1.3 APIs are not available anymore. Define them ourselves here.
+ */
+#ifndef ap_copy_table
+
+#define ap_copy_table apr_table_copy
+#define ap_cpystrn apr_cpystrn
+#define ap_destroy_pool apr_pool_destroy
+#define ap_isspace apr_isspace
+#define ap_make_array apr_array_make
+#define ap_make_table apr_table_make
+#define ap_null_cleanup apr_pool_cleanup_null
+#define ap_palloc apr_palloc
+#define ap_pcalloc apr_pcalloc
+#define ap_psprintf apr_psprintf
+#define ap_pstrcat apr_pstrcat
+#define ap_pstrdup apr_pstrdup
+#define ap_pstrndup apr_pstrndup
+#define ap_push_array apr_array_push
+#define ap_register_cleanup apr_pool_cleanup_register
+#define ap_snprintf apr_snprintf
+#define ap_table_add apr_table_add
+#define ap_table_do apr_table_do

可能是代码没帖全,或者是我的服务器配置有问题..所以错误依旧..于是又找到了正文:按照正文的源码,问题解决:
完整的配置步骤如下:
1. 我的Apache用的是2.2.4版本,安装参考Readme文件,遵循如下步骤:

 

$ cd
$ cp Makefile.AP2 Makefile            //制作Makefile文件

然后请参考下面的代码
$ vi a                                            //建立patch文件,具体代码在下面..
$ patch -fcgi.h < a                         //写入fcgi.h 文件
  File to patch: fcgi.h                    //操作结果
  patching file fcgi.h

----------------------------------- 确定以上步骤完全OK后,再继续下面的操作
$ make                                         //在这里修改的时候,要注意你的默认目录
$ make install

//install之后,会出现这个提示,说是找不到目录规则,不过不要紧.继续

make[1]: Entering directory `/opt/mod_fastcgi-2.4.2'
/opt/httpd-2.2.0/srclib/apr/libtool --silent --mode=install cp mod_fastcgi.la /opt/apache/modules/
make[1]: Leaving directory `/opt/mod_fastcgi-2.4.2'

 

If your Apache2 installation isn't in /usr/local/apache2, then
set the top_dir variable when running make (or edit the
Makefile), e.g. ( 这里是说,如果你的apache目录不在 /usr/local/apache2 这个地方,请手工更改文件Makefile的目录指向, )

$ make top_dir=/usr/local/httpd

 //打开httpd.conf文件,配置如下

Add an entry to httpd.conf like this:

LoadModule fastcgi_module modules/mod_fastcgi.so

 

@@ -73,6 +73,36 @@
 #define ap_reset_timeout(a)
 #define ap_unblock_alarms()
 
+/* starting with apache 2.2 the backward-compatibility defines for
+ * 1.3 APIs are not available anymore. Define them ourselves here.
+ */
+#ifndef ap_copy_table
+
+#define ap_copy_table apr_table_copy
+#define ap_cpystrn apr_cpystrn
+#define ap_destroy_pool apr_pool_destroy
+#define ap_isspace apr_isspace
+#define ap_make_array apr_array_make
+#define ap_make_table apr_table_make
+#define ap_null_cleanup apr_pool_cleanup_null 
+#define ap_palloc apr_palloc
+#define ap_pcalloc apr_pcalloc
+#define ap_psprintf apr_psprintf
+#define ap_pstrcat apr_pstrcat
+#define ap_pstrdup apr_pstrdup
+#define ap_pstrndup apr_pstrndup
+#define ap_push_array apr_array_push
+#define ap_register_cleanup apr_pool_cleanup_register
+#define ap_snprintf apr_snprintf
+#define ap_table_add apr_table_add
+#define ap_table_do apr_table_do
+#define ap_table_get apr_table_get
+#define ap_table_set apr_table_set
+#define ap_table_setn apr_table_setn
+#define ap_table_unset apr_table_unset
+
+#endif /* defined(ap_copy_table) */
+
 #if (defined(HAVE_WRITEV) && !HAVE_WRITEV && !defined(NO_WRITEV)) || defined WIN32
 #define NO_WRITEV
 #endif
diff -ruN mod_fastcgi-2.4.2/Makefile.AP2 mod_fastcgi-2.4.2-ap22/Makefile.AP2
--- mod_fastcgi-2.4.2/Makefile.AP2    2002-07-29 03:36:34.000000000 +0200
+++ mod_fastcgi-2.4.2-ap22/Makefile.AP2    2005-12-07 20:27:50.000000000 +0100
@@ -20,8 +20,6 @@

绿色的是两个不一样的地方..


 

 

posted on 2007-09-13 12:05  难得一蠢  阅读(2141)  评论(0编辑  收藏  举报