Apache 2.4 + PHP-FPM + mod_fastcgi(设置PHP-FPM的问题)

我一直在试图让PHP-FPM与Apache 2.4一起工作,但mod_fastcgi不能在2.4下工作。 有没有解决这个问题? 我想使用UNIX套接字来运行它,但我找不到任何教程,他们都使用127.0.0.1:9000

我使用mod_fastcgi安装了Apache 2.2,它使用UNIX套接字。

从我的httpd.confconfiguration片段是:

<IfDefine FASTCGI> <IfModule mod_fastcgi.c> Alias /php5.fastcgi /var/www/example.com/cgi-bin/php5.fastcgi FastCGIExternalServer /var/www/example.com/cgi-bin/php5.fastcgi -flush -socket /var/www/example.com/php-fpm.sock -idle-timeout 30 AddType application/x-httpd-fastphp5 .php Action application/x-httpd-fastphp5 /php5.fastcgi DirectoryIndex index.php index.html </IfModule> </IfDefine> 

PHP-FPM正在侦听socket /var/www/example.com/php-fpm.sock。

PHP-FPM的configuration(在池中):

 listen = /var/www/$pool/php-fpm.sock listen.owner = apache listen.group = apache listen.mode = 0660 

我没有成功与mod_fcgi。 Apache 2.4现在有mod_proxy_fcgi,我没有testing过。 你需要一些可以与外部FastCGI服务器一起工作的东西,而不要pipe理这些进程本身。

mod_fastcgi有一个针对Apache 2.4的补丁: ByteInternet / libapache-mod-fastcgi (目前,标签字节/ 2.4.6-1byte6 + apache24和分支字节包含了这个补丁。)

在使用apxs编译模块之前,应用以下补丁:

 patch --input=debian/patches/byte-compile-against-apache24.diff 

然后编译/安装/激活:

 apxs -ciao mod_fastcgi.so *.c