【问题标题】:Error during libapache2-mod-fastcgi installationlibapache2-mod-fastcgi 安装期间出错
【发布时间】:2016-02-27 08:05:44
【问题描述】:

我尝试安装 php5-fpm,但目前在尝试安装 libapache2-mod-fastcgi 安装时卡住了。

我收到以下消息:

After this operation, 250 kB of additional disk space will be used.
Selecting previously unselected package libapache2-mod-fastcgi.
(Reading database ... 63345 files and directories currently installed.)
Preparing to unpack .../libapache2-mod-fastcgi_2.4.7~0910052141-1.1_amd64.deb ...
Unpacking libapache2-mod-fastcgi (2.4.7~0910052141-1.1) ...
Setting up libapache2-mod-fastcgi (2.4.7~0910052141-1.1) ...
apache2_invoke: Enable module fastcgi
Action 'configtest' failed.
The Apache error log may have more information.
apache2_reload: Your configuration is broken. Not restarting Apache 2

我会尽快发布我的 apache 日志,因为它是一个大文件,我需要先对其进行解析。

顺便说一下,我做了一个快速的:

grep -RIs "FastCgiExternalServer" /etc/apache2

得到以下回复:

/etc/apache2/conf-available/php5-fpm.conf:FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -socket /var/run/php5-fpm.sock -pass-header Authorization

当我尝试重新启动 Apache 时:

 * Restarting web server apache2                                                                                                        [fail] 
 * The apache2 configtest failed.
Output of config test was:
AH00526: Syntax error on line 4 of /etc/apache2/mods-enabled/fastcgi.conf:
FastCgiIpcDir /var/lib/apache2/fastcgi: access for server (uid 33, gid 33) failed: write not allowed
Action 'configtest' failed.
The Apache error log may have more information.

这是包含违规行的文件:

<IfModule mod_fastcgi.c>
  AddHandler fastcgi-script .fcgi
  #FastCgiWrapper /usr/lib/apache2/suexec
  FastCgiIpcDir /var/lib/apache2/fastcgi
</IfModule>

谁能帮帮我?

【问题讨论】:

  • 所以我找到了解决方案,结果发现以下文件夹 /var/lib/apache2/fastcgi 不属于 www-data。将其所有权更改为 www-data 后,我可以重新启动 apache2。

标签: php apache2 fastcgi


【解决方案1】:

我有同样的错误。最初 /var/lib/apache2/fastcgi 已归 www-data 所有。我不得不将 /var/lib/apache2/fastcgi(所有文件/递归)的权限更改为 0777。我尝试了 0744 和 0755,但这些配置仍然存在错误。

【讨论】:

  • sudo chmod -R 775 /var/lib/apache2/fastcgi 为我工作。
  • 我也遇到过同样的问题,对我来说 0775 还不够。 www-data 既是该文件的所有者又是组:0707 也同样有效。对于所有用户来说,任何小于 7 的值都是不够的。我打电话给sudo service apache2 restart。如何发现哪个用户实际在 fastcgi 目录上执行操作?
猜你喜欢
  • 2019-04-03
  • 2015-10-10
  • 2017-12-29
  • 1970-01-01
  • 2023-03-24
  • 2015-01-17
  • 2016-06-25
  • 2018-11-08
  • 2017-02-03
相关资源
最近更新 更多