本地主机无法在 WAMP 中打开
我的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您看到的代码是顶部 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.
您需要确保 apache 配置了正确的处理程序和模块来解释 php 而不是为其提供服务。
文件 IIRC 是 httpd.conf,模块和处理程序实际列出但被注释掉的可能性很高
you need to ensure apache is configured with the proper
handler
andmodule
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