无法使用 Apache 2.4 配置快速 CGI

无法使用 Apache 2.4 配置快速 CGI

我正在尝试在本地服务器上配置 fastcgi(fcgi)。

按照以下步骤操作

apt-get remove libapache2-mod-php5
apt-get install libapache2-mod-fcgid
apt-get install php5-cgi
a2dismod mpm_prefork
a2enmod mpm_worker

包装器 /usr/local/bin/php-wrapper 具有以下内容:

#!/bin/sh
# Set desired PHP_FCGI_* environment variables.
# Example:
# PHP FastCGI processes exit after 500 requests by default.
PHP_FCGI_MAX_REQUESTS=10000
export PHP_FCGI_MAX_REQUESTS

# Replace with the path to your FastCGI-enabled PHP executable
exec /usr/bin/php-cgi

还包括以下内容/etc/apache2/sites-enabled/000-default

<Ifmodule mod_fcgid.c>
    # FCGID registers a handler named fcgid-script
    AddHandler fcgid-script .php
    Options +ExecCGI
    FcgidWrapper /usr/local/bin/php-fcgid-wrapper
</IfModule>

将其放置在 vhost 块下,然后

<Ifmodule mod_fcgid.c>
    # Context - server config
    FcgidMaxProcesses 150
    # Otherwise php output shall be buffered
    FcgidOutputBufferSize 0
</IfModule>

根据教程在 vhost 块之外

这些步骤已在教程中列出,完成这些步骤后,当我重新启动 Apache 时出现以下错误:

[Sun Feb 14 22:52:07.754730 2016] [:crit] [pid 4125:tid 140496425252736] Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe.  You need to recompile PHP.
AH00013: Pre-configuration failed
Action 'restart' failed.
The Apache error log may have more information

我用 Google 搜索了有关这个错误的信息,大多数都提到了这一点,apt-get install php-cgi 所以我不知道如何调试这个问题。

apache 日志显示此

[Sun Feb 14 21:12:15.855814 2016] [core:notice] [pid 3362] AH00094: Command line: '/usr/sbin/apache2'
[Sun Feb 14 21:12:24.602322 2016] [mpm_prefork:notice] [pid 3362] AH00169: caught SIGTERM, shutting down
[Sun Feb 14 21:12:29.981599 2016] [mpm_prefork:notice] [pid 3432] AH00163: Apache/2.4.7 (Ubuntu) mod_fcgid/2.3.9 PHP/5.5.9-1ubuntu4.14 configured -- resuming normal operations
[Sun Feb 14 21:12:29.981673 2016] [core:notice] [pid 3432] AH00094: Command line: '/usr/sbin/apache2'

谁能指导或帮助我了解为什么会发生这种情况。

相关内容