尝试从外部访问index.php时,它出现404错误


Getting a 404 Error for index.php when trying to access it externally

经过广泛的搜索,反复检查安装,重新安装,故障排除,我不知道下一步该去哪里。

背景:

  • 我正在尝试使用MediaWiki使wiki正常工作
  • 我已经为IIS 7安装了PHP管理器
  • 我在同一台机器上安装了一台MySQL服务器
  • PHP版本为5.6.5,安装在C:'PHP

主要问题:我可以在本地查看index.php文件,但不能在外部查看。

如果链接到/w/目录,我会得到一个通用的page can't be displayed错误。

根据浏览器的不同,当链接到w/index.php:时,我会得到两个结果

  1. page can't be displayed
  2. IIS 404.0 Error.

根据浏览器的不同,我会得到两个链接到w/index.php?title=Main_Page; 的结果

  1. IIS 404.0 Error
  2. unformatted page content

错误:

Module: IIS Web Core
Notification: MapRequestHandler
Handler: StaticFile
Error Code: 0x80070002
Requested URL: http://localhost:80/w/index.php?title=Main_Page
Physical Path: C:'inetpub'wwwroot'w'index.php
Logon Method: Anonymous
Logon User: Anonymous

故障排除完成:

  • PHP管理器没有显示错误
  • 切换了PHP版本(无效)
  • 外部测试了在HTML中运行的其他PHP表单(运行良好)
  • 已检查所有文件夹的权限(很好)
  • 已编辑"处理程序映射"下的功能权限以允许执行(无更改)
  • 已更改PHP_via_FastCGI的访问限制以执行(无更改)
  • 检查以确保PHP处理映射设置为*.php(它是)
  • 选中Default Document settings和index.php。在w/中外部测试了index.html(通过直接链接到文件和链接到文件夹来工作)
  • 外部尝试测试/w/index.html,其中包含PHP "Hello World"(空白页)

我做错了什么?在服务器上本地运行,一切都非常正常。

正如Chrispher所说,localhost在从外部联系的URL中是错误的:如果你看到的是这样,你就忘记了正确设置$wgServer。