使用 php-fpm 的 Prestashop 出现不完整的标头错误

使用 php-fpm 的 Prestashop 出现不完整的标头错误

我正在尝试使用 apache 运行 prestashop。我已启用 mpm_event 模块。这是我的虚拟主机配置

当我访问网站时出现错误

Apache 错误日志

虚拟主机配置文件

<VirtualHost *:8080>
ServerName prestashop.varnish.com
ServerAlias www.prestashop.varnish.com
DocumentRoot /var/www/prestashop
CustomLog /var/log/apache2/prestashop_access.log combined
ErrorLog  /var/log/apache2/prestashop_error.log
<IfModule mod_fastcgi.c>
    AddHandler php5-fcgi .php
    #Action php5-fcgi /php7-fcgi
    #Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
    FastCgiExternalServer /var/www/prestashop -socket /var/run/php/php5-fpm.sock -pass-header Authorization
</IfModule>

<Directory /var/www/prestashop>
    Options Indexes Multiviews FollowSymLinks
    Require all granted
    AllowOverride all
</Directory>
</VirtualHost>

错误日志

[Sat Oct 08 08:25:09.896291 2016] [fastcgi:error] [pid 7993:tid 140080677115648] (2)No such file or directory: [client 192.168.10.205:58254] FastCGI: failed to connect to server "/var/www/prestashop/index.php": connect() failed
[Sat Oct 08 08:25:09.896360 2016] [fastcgi:error] [pid 7993:tid 140080677115648] [client 192.168.10.205:58254] FastCGI: incomplete headers (0 bytes) received from server "/var/www/prestashop/index.php"
[Sat Oct 08 08:25:09.909828 2016] [fastcgi:error] [pid 7993:tid 140080668722944] (2)No such file or directory: [client 192.168.10.205:58255] FastCGI: failed to connect to server "/var/www/prestashop/index.php": connect() failed, referer:
[Sat Oct 08 08:25:09.909880 2016] [fastcgi:error] [pid 7993:tid 140080668722944] [client 192.168.10.205:58255] FastCGI: incomplete headers (0 bytes) received from server "/var/www/prestashop/index.php", referer: 

答案1

使用时,FastCGIExternalServer您必须自行启动该进程。错误表明它未启动或未监听提供的套接字

但是如果你要这样做,而且你正在使用 Apache v2.4,那么你绝对应该使用 mod_proxy_fcgi 和php-fpm

这里有一些额外的信息:https://stackoverflow.com/questions/37082036/difference-between-fastcgiexternalserver-and-fastcgiserver-in-apache-fastcgi-php

mod_proxy_fcgi编辑:链接到和的配置指南php-fpmhttp://wiki.apache.org/httpd/PHP-FPM

相关内容