Apache2 如何将Apache 2.4中所有虚拟主机的.php文件请求重定向到php-FPM?

Apache2 如何将Apache 2.4中所有虚拟主机的.php文件请求重定向到php-FPM?,apache2,php,Apache2,Php,在转发所有指向phisical.php文件的请求时,如下所示: LoadModule模块/mod_fastcgi.so FastCGIExternalServer /usr/sbin/php-fpm -socket /usr/local/php/lib/php.sock -idle-timeout 900 AddHandler php-fastcgi .php Action php-fastcgi /usr/sbin/php-fpm.fcgi ScriptAlias /usr/sbin/php-

在转发所有指向phisical.php文件的请求时,如下所示:

LoadModule模块/mod_fastcgi.so

FastCGIExternalServer /usr/sbin/php-fpm -socket /usr/local/php/lib/php.sock -idle-timeout 900
AddHandler php-fastcgi .php
Action php-fastcgi /usr/sbin/php-fpm.fcgi
ScriptAlias /usr/sbin/php-fpm.fcgi /usr/sbin/php-fpm
但不同的是,我遵循中的教程,但我不理解为对所有虚拟主机启用PHP,而不是每个虚拟主机

我在PHP文档中搜索,没有提到在Apache 2.4上安装:

仅供参考,感谢+迭木齐的解决方案是:

<IfModule mod_fastcgi.c>
    DirectoryIndex index.php index.shtml index.cgi index.html index.htm
    AddHandler php5-fcgi .php
    Action php5-fcgi /php5-fcgi
    Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
    FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -socket /var/lib/php/php.sock  -idle-timeout 900 -pass-header Authorization
</IfModule>

DirectoryIndex.php index.shtml index.cgi index.html index.htm
AddHandler php5 fcgi.php
行动php5 fcgi/php5 fcgi
别名/php5 fcgi/usr/lib/cgi-bin/php5 fcgi
FastCgiExternalServer/usr/lib/cgi-bin/php5 fcgi-socket/var/lib/php/php.sock-idle timeout 900-pass header Authorization

也许这会对你有所帮助。这是我设置Apache 2.4/mod_fastcgi/PHP-FPM->

的工作配置,请共享解决方案。@Nullpointer阅读接受的答案。