简体   繁体   English

本地主机无法在WAMP中打开

[英]localhost doesn't open in WAMP

My WAMP server was working fine and I have drupal and another personal php project running in it's www directory. 我的WAMP服务器运行正常,并且在它的www目录中运行着drupal和另一个个人php项目。 All was fine. 一切都很好。

But lately, I tried to configure SVN server with Apache and after that when I try http://localhost The following code gets downloaded instead of displaying WAMP homepage. 但是最近,我尝试使用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();

Also tried opening a static page and it worked. 还尝试打开静态页面,它可以正常工作。 http://localhost/index.html HTTP://localhost/index.html

The code you are seeing is the index.php file in the top Drupal directory. 您看到的代码是顶部Drupal目录中的index.php文件。 Apache should be running it instead of returning it to you. Apache应该正在运行它,而不是将其返回给您。 A Google search finds http://www.gentoo.org/proj/en/apache/doc/troubleshooting.xml#doc_chap4 which suggests that this is a browser cache problem. Google搜索发现http://www.gentoo.org/proj/en/apache/doc/troubleshooting.xml#doc_chap4 ,这表明这是浏览器缓存问题。

you need to ensure apache is configured with the proper handler and module for interpreting php instead of serving it. 您需要确保为apache配置了正确的handlermodule来解释php,而不是为其提供服务。

the file IIRC is httpd.conf and chances are high that the module and handler actually listed but commented out IIRC文件是httpd.conf,模块和处理程序实际列出但被注释掉的几率很高

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM