本地主机无法在 WAMP 中打开

发布于 2024-12-05 01:12:31 字数 860 浏览 1 评论 0原文

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

但最近,我尝试使用 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

My WAMP server was working fine and I have drupal and another personal php project running in it's www directory. 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.

<?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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

枕花眠 2024-12-12 01:12:31

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

The code you are seeing is the index.php file in the top Drupal directory. Apache should be running it instead of returning it to you. 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.

眼眸里的那抹悲凉 2024-12-12 01:12:31

您需要确保 apache 配置了正确的处理程序和模块来解释 php 而不是为其提供服务。

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

you need to ensure apache is configured with the proper handler and module for interpreting php instead of serving it.

the file IIRC is httpd.conf and chances are high that the module and handler actually listed but commented out

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文