![升级到 wheezy 后,带有 fcgid 的 php 不再起作用](https://linux22.com/image/642629/%E5%8D%87%E7%BA%A7%E5%88%B0%20wheezy%20%E5%90%8E%EF%BC%8C%E5%B8%A6%E6%9C%89%20fcgid%20%E7%9A%84%20php%20%E4%B8%8D%E5%86%8D%E8%B5%B7%E4%BD%9C%E7%94%A8.png)
我最近升级的服务器出现了一些问题Debian Squeeze到Debian 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>
我知道这帖子,但解决方案对我不起作用。我尝试重命名,FCGIWrapper
但FcgidWrapper
没有帮助。此外,我还有另一台服务器正在运行喘息完全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
所以我不知道如何解决这个问题。任何帮助都将不胜感激!