php(5.3.8)和apache2使用php-fpm时如何设置httpd.conf?

我想用php(5.3.8)在apache2中使用fastcgi。

我在apache中安装了fastcgi_module,并且用–enable-fpm编译了php。 我还发现了一些教程,在他们的设置中有两种方法:

FastCgiServer / usr / local / apache2 / fcgi-bin / php-cgi -processes 10

要么

FastCgiExternalServer / usr / local / apache2 / fcgi-bin / php-cgi -host 127.0.0.1:9000

但是我无法在php 5.3.8中findphp-cgi 。 接下来我应该怎么做?如何在使用php-fpm和php(5.3.8)和apache2时设置httpd.conf?

这里的秘密是php-cgi不是一个真正的文件,而是在Apache中内部使用的一个错误的文件名。 你也可以调用它: false-php-cgi-catcher-which-do-not-exists

我几天前在这里写了一个完整的php-fpm + apache2.2 + chroot安装指南 。 你可以看一下。 但是先尝试在没有chroot的情况下工作。 注意,从apache 2.3开始,php-fpm的最佳工具是mod_proxy_fcgi

以下是完整安装指南的摘录。 我使用php5.external你想用php-cgi

 # phpfpm/fastcgi # Here we catch the 'false' Location used to inexistent php5.external # and push it to the external FastCgi process via a socket # note: socket path is relative to FastCgiIpcDir # which is set in Main configuration /etc/apache2/mods-available/fastcgi.conf <IfModule mod_fastcgi.c> # all .php files will be pushed to a php5-fcgi handler AddHandler php5-fcgi .php #action module will let us run a cgi script based on handler php5-fcgi Action php5-fcgi /fcgi-bin/php5.external # and we add an Alias to the fcgi location Alias /fcgi-bin/php5.external /php5.external # now we catch this cgi script which in fact does not exists on filesystem # we catch it on the url (Location) <Location /fcgi-bin/php5.external> # here we prevent direct access to this Location url, # env=REDIRECT_STATUS will let us use this fcgi-bin url # only after an internal redirect (by Action upper) Order Deny,Allow Deny from All Allow from env=REDIRECT_STATUS </Location> </IfModule> FastCgiExternalServer /php5.external -socket myapplication.sock -appConnTimeout 30 -idle-timeout 60