更新

更新

我使用 repo 在 centos 6.6 上安装了 php 5.6、apache 2.2 和 php-fpm

https://webtatic.com/packages/php56/

我按照这个说明尝试让 php-fpm 工作 http://www.garron.me/en/linux/apache-mpm-worker-php-fpm-mysql-centos.html

但与教程相比,还是有一点不同:

  • fcgi 模块 conf 文件位置位于 /etc/httpd/conf.d/fcgid.conf
  • 此位置没有 /var/lib/cgi-bin/php5-fcgi
  • 此位置没有 /var/run/php5-fpm.sock

权限管理配置文件

# This is the Apache server configuration file for providing FastCGI support
# through mod_fcgid
#
# Documentation is available at
# http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html

LoadModule fcgid_module modules/mod_fcgid.so

# Use FastCGI to process .fcg .fcgi & .fpl scripts
AddHandler fcgid-script fcg fcgi fpl

# Sane place to put sockets and shared memory file
FcgidIPCDir /var/run/mod_fcgid
FcgidProcessTableFile /var/run/mod_fcgid/fcgid_shm

更新

<IfModule mod_fastcgi.c>
  ScriptAlias /fcgi-bin/ /usr/bin/
    AddType application/x-httpd-php .php
    AddHandler php-fastcgi .php
    Action php-fastcgi /fcgi-bin/php-cgi
    FastCgiExternalServer /usr/bin/php-cgi -host 127.0.0.1:9000
</IfModule>

有人知道如何配置吗?phpinfo 中没有显示 php-fpm 信息,我使用 echo php_sapi_name();,它返回“cgi-fcgi”

我尝试删除,出现错误“FastCgiExternalServer”命令无效,可能是拼写错误或定义错误

答案1

您正在使用 fcgid 模块但没有使用 mod_fastcgi,没有 FastCgiExternalServer 指令。但我不知道如何将 fcgid 和 php-fpm 结合在一起。

答案2

我最终使用 nginx 与 php-fpm 配合使用,而 apache 可以继续打开

相关内容