【发布时间】:2014-09-19 03:02:27
【问题描述】:
我正在尝试将 php 从 fcgid 切换到 fpm。我已经用谷歌搜索了这个问题,虽然有些问题看起来一样,但我仍然无法解决。
我正在运行 CentOS 6.5、Apache 2.2、PHP 5.4。我安装了 mod_fastcgi 和 php-fpm。 PHP 在 shell 中工作,但我通过浏览器收到 403 错误。显然,Apache 没有正确传递请求。安装后,我做了以下更改:
将 /etc/httpd/conf.d/fcgid.conf 重命名为 fcgid.conf.disabled
将以下内容添加到 /etc/httpd/conf.d/fastcgi.conf
<IfModule mod_fastcgi.c>
DirectoryIndex index.html index.shtml index.cgi index.php
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 -host 127.0.0.1:9000 -pass$
<Directory "/usr/lib/cgi-bin">
Order allow,deny
<Files "php5.fastcgi">
Order deny,allow
</Files>
</Directory>
</IfModule>
我还创建了目录 /usr/lib/cgi-bin 并将其更改为 apache.apache(不确定是否有必要)。
我没有在我的任何虚拟主机声明中添加任何内容。所有其他文件都解析,只是不是 PHP。
非常感谢任何帮助。谢谢。
【问题讨论】:
标签: apache php centos6 http-status-code-403 mod-fastcgi