我在最近从Debian Squeeze升级到Debian Wheezy的服务器上遇到了一些问题。
当我打电话给一个php页面时,只有页面的php-source-code是beeing show,但没有解释为脚本。
PHPconfiguration为fcgid :
<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>
我知道如果这个职位,但解决scheme不适合我。 我尝试将FCGIWrapper
重命名为没有帮助的FcgidWrapper
。 除了我有另一台服务器运行Wheezy与FCGIWrapper
绝对好。 所以我怀疑这个解决scheme。
运行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="
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
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
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
所以我不知道如何解决这个问题。 任何帮助将非常感激,非常感谢!
这个问题是由php5_cgi
造成的。
要解决此问题,请禁用php5_cgi
:
a2dismod php5_cgi
更多信息可以在这里和这里find。