升级到 wheezy 后,带有 fcgid 的 php 不再起作用

升级到 wheezy 后,带有 fcgid 的 php 不再起作用

我最近升级的服务器出现了一些问题Debian SqueezeDebian Wheezy

当我调用 php 页面时,仅显示该页面的 php 源代码,但不会将其解释为脚本。

php 配置为权限组

    <IfModule mod_fcgid.c>
            SuexecUserGroup my-client my-client
            FcgidIOTimeout 240
            <Directory /var/www/my-client.de/www/>
                    Options +ExecCGI
                    AllowOverride All
                    AddHandler fcgid-script .php
                    FCGIWrapper /var/www/my-client.de/php-fcgi-scripts/php-fcgi-starter .php
                    Order allow,deny
                    Allow from all
            </Directory>
    </IfModule>

我知道帖子,但解决方案对我不起作用。我尝试重命名,FCGIWrapperFcgidWrapper没有帮助。此外,我还有另一台服务器正在运行喘息完全FCGIWrapper没问题。所以我对这个解决方案表示怀疑。

运行后apachectl -t -D DUMP_MODULES得到以下结果:

Loaded Modules:
 core_module (static)
 log_config_module (static)
 logio_module (static)
 version_module (static)
 mpm_worker_module (static)
 http_module (static)
 so_module (static)
 actions_module (shared)
 alias_module (shared)
 auth_basic_module (shared)
 authn_file_module (shared)
 authz_default_module (shared)
 authz_groupfile_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 cgid_module (shared)
 dir_module (shared)
 env_module (shared)
 expires_module (shared)
 fastcgi_module (shared)
 fcgid_module (shared)
 headers_module (shared)
 include_module (shared)
 jk_module (shared)
 mime_module (shared)
 negotiation_module (shared)
 proxy_module (shared)
 proxy_html_module (shared)
 proxy_http_module (shared)
 reqtimeout_module (shared)
 rewrite_module (shared)
 setenvif_module (shared)
 ssl_module (shared)
 status_module (shared)
 suexec_module (shared)
Syntax OK

该条目fcgid_module (shared)告诉我fcgid 模块<IfModule mod_fcgid.c>应该被加载,从而满足主机文件的条件。

此外我还检查了文件/var/www/my-client.de/php-fcgi-scripts/php-fcgi-starter

#!/bin/sh
PHPRC=/var/www/my-client.de/php
export PHPRC
export PHP_FCGI_MAX_REQUESTS=5000
exec /usr/lib/cgi-bin/php

该目录/var/www/my-client.de/php和二进制文件/usr/lib/cgi-bin/php均可访问。

grep -Hrv ";" /etc/php5 | grep -i "extension="给我:

/etc/php5/mods-available/pdo_mysql.ini:extension=pdo_mysql.so
/etc/php5/mods-available/mysqli.ini:extension=mysqli.so
/etc/php5/mods-available/gd.ini:extension=gd.so
/etc/php5/mods-available/mcrypt.ini:extension=mcrypt.so
/etc/php5/mods-available/mysql.ini:extension=mysql.so
/etc/php5/mods-available/pdo.ini:extension=pdo.so
/etc/php5/mods-available/curl.ini:extension=curl.so

dpkg -l | grep ^ii | grep -i fcgi给我:

ii  libapache2-mod-fcgid                 1:2.3.6-1.2+deb7u1               i386         an alternative module compat with mod_fastcgi

dpkg -l | grep ^ii | grep -i php给我:

ii  dh-make-php                          0.3.0                            all          Creates Debian source packages for PHP PEAR and PECL extensions
ii  php-pear                             5.4.4-14+deb7u14                 all          PEAR - PHP Extension and Application Repository
ii  php5-cgi                             5.4.4-14+deb7u14                 i386         server-side, HTML-embedded scripting language (CGI binary)
ii  php5-cli                             5.4.4-14+deb7u14                 i386         command-line interpreter for the php5 scripting language
ii  php5-common                          5.4.4-14+deb7u14                 i386         Common files for packages built from the php5 source
ii  php5-curl                            5.4.4-14+deb7u14                 i386         CURL module for php5
ii  php5-dev                             5.4.4-14+deb7u14                 i386         Files for PHP5 module development
ii  php5-gd                              5.4.4-14+deb7u14                 i386         GD module for php5
ii  php5-mcrypt                          5.4.4-14+deb7u14                 i386         MCrypt module for php5
ii  php5-mysql                           5.4.4-14+deb7u14                 i386         MySQL module for php5

所以我不知道如何解决这个问题。任何帮助都将不胜感激!

答案1

该问题是由 引起的php5_cgi

要解决此问题,请停用php5_cgi

a2dismod php5_cgi

更多信息请见这里这里

相关内容