【问题标题】:Drupal site source code and index.php errorDrupal站点源代码和index.php错误
【发布时间】:2014-05-12 15:01:16
【问题描述】:

我正在尝试将现有的 Drupal 6 站点从 IIS 服务器迁移到使用 Linux 和 Apache 的 AWS 实例和数据库。

我一直按照这篇文章的说明进行操作:

http://www.imamuseum.org/cc-mcn09.pdf

我已跳过文章的“配置 MySQL”部分,因为我目前从 AWS 使用的数据库是 MySQL DB。

到目前为止,我... 将源代码转移到 /ebsvol/apache/www 目录。

更改了“数据库 URL 格式:”下的 /ebsvol/apache/www/sites/default/settings.php 文件以匹配新的 Ec2 实例数据库信息。

更改了 /etc/httpd/conf/httpd.conf 文件以包含以下虚拟主机:

<VirtualHost 00.00.00.003:80> 
#ServerAdmin root
DocumentRoot /ebsvol/apache/www 
#ServerName my.test.site.edu 
#ServerAlias www.my.test.site.edu 
ErrorLog /ebsvol/apache/log/error.log 
TransferLog /ebsvol/apache/log/access.log 

<Directory /ebsvol/apache/www> 
    AllowOverride All 
</Directory> 
</VirtualHost>

现在,当我打开 Ec2 实例公共 DNS 时,页面显示此错误消息,原来是我的 Drupal 源代码中的 index.php 文件:

<?php
// $Id: index.php,v 1.94 2007/12/26 08:46:48 dries Exp $

/**
* @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.
*/
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);


require_once './includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);

$return = menu_execute_active_handler();

// Menu status constants are integers; page content is a string.
if (is_int($return)) {
switch ($return) {
case MENU_NOT_FOUND:
  drupal_not_found();
  break;
case MENU_ACCESS_DENIED:
  drupal_access_denied();
  break;
case MENU_SITE_OFFLINE:
  drupal_site_offline();
  break;
 }
}
elseif (isset($return)) {
// Print any value (including an empty string) except NULL or undefined:
print theme('page', $return);
}

drupal_page_footer();

有谁知道为什么 Drupal 站点只读取 index.php 文件而不是整个源代码?

如果您需要更多信息,请告诉我。

谢谢,

【问题讨论】:

    标签: php apache drupal amazon-ec2 drupal-6


    【解决方案1】:

    如果它真的输出了 PHP 源代码,这意味着你没有配置 Apache 来通过 PHP 解析脚本。您链接到的 PDF 没有说明如何做到这一点。如果您使用的是 fedora,它类似于以下内容,但包名称可能会有所不同。

    sudo yum install php php-mysql
    

    【讨论】:

    • 感谢奥斯卡的建议。不幸的是,这并没有解决问题。我运行了这个命令行: cat /etc/issue 并在 \m 上收到了这个 Amazon Linux AMI 版本 2014.03 内核 \r 所以我假设我没有运行 Fedora。
    • 我找到了!答案在此链接中:thingaweek.com/how-install-drupal-amazon-ec2 我有一些问题,首先我必须运行文档给我的安装,我还必须重新启动 Apache 服务器。几天来我一直在尝试解决这个问题,所以我很高兴我终于把它启动并运行了:)
    • 太棒了!你必须更新内核吗?我很好奇为什么您必须重新启动整个服务器,这在使用 Apache 时非常罕见。如果您需要重新启动 Apache 或 Mysql 来重新加载您的配置,您只需重新启动服务即可。通常通过sudo service apache2 restartsudo system restart http.service 取决于分布。
    • 我相信我在这个命令行中遗漏了一些东西:sudo yum -y install httpd mysql mysql-server php php-cli php-gd php-intl php-mbstring php-mysql php-pdo php- pear php-xml php-xmlrpc 它可能是命令行安装到服务器上的多个 php 安装之一。我希望我能帮助分解一下,但我对这种类型的工作还很陌生......
    • 我也使用了这些命令行:sudo cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.old sudo vi /etc/httpd/conf/httpd。 conf 并将 更改为 "AllowOverride All" 但这让我有点困惑,因为我所有的源代码都在 /ebsvol/apache/www/ 目录中......跨度>
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多