参考以下内容:
./configure --prefix=/opt/httpd/2.4 --enable-mods-shared=all --enable-ssl=shared --with-ssl=/usr --with-included-apr --enable-mods-shared=all 表示安装所有模块 httpd的apxs类似php的phpize,用于添加httpd的额外模块,libphp5.so(mod_php)就是这样的一个模块, 所以php在编译时加入对apache的支持需要指定apxs的位置--with-apxs2=/httpd/2.4/bin/apxs 又比如编译后构建Apache FastCGI进程管理器模块mod_fcgid tar xjf mod_fcgid-2.3.9.tar.bz2 && cd mod_fcgid-2.3.9 APXS=/png/httpd/2.4.17/bin/apxs ./configure.apxs make && make install httpd.conf配置: #载入mod_fcgid模块(不能和php5_module同时使用) LoadModule fcgid_module modules/mod_fcgid.so AddHandler fcgid-script .php #防止PHP-CGI进程在处理完所有请求前退出,PHP_FCGI_MAX_REQUESTS 应该大于或等于 FcgidMaxRequestsPerProcess. FcgidInitialEnv PHP_FCGI_MAX_REQUESTS 10000 FcgidMaxRequestsPerProcess 10000 FcgidMaxProcesses 5 FcgidIOTimeout 40 FcgidIdleTimeout 300 #代码加密扩展Beast不兼容PHP-CGI运行模式 FcgidWrapper /png/php/5.4.45/bin/php-cgi .php #在需要使用PHP-CGI来执行PHP的Directory加上Options +ExecCGI,比如: <Directory "/png/www/a.com/public_html/fcgid"> Options +ExecCGI </Directory> mod_fcgid 可以用来替代 mod_cgi 和 mod_cgid, 具有管理和维持PHP-CGI进程数目的功能, 而 mod_proxy_fcgi 应该是类似 Nginx fastcgi_pass 的东西. http://httpd.apache.org/mod_fcgid/ ApacheLounge提供有Windows上的mod_fcgid二进制包: http://www.apachelounge.com/download/