首页 文章

localhost无法在WAMP中打开

提问于
浏览
1

我的WAMP服务器工作正常,我有drupal和另一个在其www目录中运行的个人php项目 . 一切都很好 .

但是最近,我尝试用Apache配置SVN服务器,之后我尝试http://localhost以下代码被下载而不是显示WAMP主页 .

<?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();

还尝试打开一个静态页面,它工作 . http://localhost/index.html

2 回答

  • 1

    您看到的代码是顶部Drupal目录中的index.php文件 . Apache应该运行它而不是将它返回给你 . Google搜索找到http://www.gentoo.org/proj/en/apache/doc/troubleshooting.xml#doc_chap4,这表明这是浏览器缓存问题 .

  • 2

    你需要确保apache配置正确的 handlermodule 来解释php而不是服务它 .

    文件IIRC是httpd.conf,并且模块和处理程序实际列出但注释掉的可能性很高

相关问题