安装了PHP5,但Apache将PHP显示为未解释的文本。 我怎样才能得到它来处理它作为PHP?

在Drupal安装中,它将在下面以纯文本forms显示根PHP文件。 a2enmod说php5是启用的,aptitude说libapache2-mod-php5已经安装,mods-enabled /有php5.conf和php5.load,VirtualHost有DirectoryIndex和ScriptHandler指定。 这有点像政府经济学家的计算机病毒:你可以find的每一个指标都说你的系统是好的,但是它不起作用。 我该怎么做才能让这个Drupal 7站点运行?

显示的页面是:

<?php /** * @file * The PHP page that serves all page requests on a Drupal installation. * * The routines here dispatch control to the appropriate handler, which then * prints the appropriate page. * * All Drupal code is released under the GNU General Public License. * See COPYRIGHT.txt and LICENSE.txt. */ /** * Root directory of Drupal installation. */ define('DRUPAL_ROOT', getcwd()); require_once DRUPAL_ROOT . '/includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); menu_execute_active_handler(); 

这听起来像apache没有正确configuration运行PHP脚本

检查这两个文件/etc/httpd/conf.d/php.conf/etc/httpd/conf/httpd.conf任何一个

 AddHandler php5-script .php AddType text/html .php 

然后重新启动Apache

service httpd restart

刚刚有同样的问题,但不是与Drupal – 最后发现了short_open_tag参数,显然现在默认为“关” – 我的应用程序完全使用短开放标签写。 将其更改为short_open_tag = On ,然后立刻上来。