无法访问 localhost/xampp/index.php

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32064142/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 22:46:52  来源:igfitidea点击:

Cannot access to localhost/xampp/index.php

phpxampplocalhost

提问by S.Joe

I just installed XAMPP for windows 7, control panel seems to work fine, I started MySql and Apache, the problem I have is, when I type localhost in my browser "Google Chrome" it sends me to "http://localhost/dashboard/"

我刚刚为 Windows 7 安装了 XAMPP,控制面板似乎工作正常,我启动了 MySql 和 Apache,我遇到的问题是,当我在浏览器“Google Chrome”中键入 localhost 时,它会将我发送到“ http://localhost/dashboard /"

when I change the url to "//localhost/xampp/index.php", it tells me: "Object not found!

当我将 url 更改为“//localhost/xampp/index.php”时,它告诉我:“找不到对象!

The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.

在此服务器上找不到请求的 URL。如果您手动输入了 URL,请检查您的拼写并重试。

If you think this is a server error, please contact the webmaster.

如果您认为这是服务器错误,请联系网站管理员。

Error 404

错误 404

localhost Apache/2.4.16 (Win32) OpenSSL/1.0.1p PHP/5.6.11"

本地主机 Apache/2.4.16 (Win32) OpenSSL/1.0.1p PHP/5.6.11"

anyone can helps me out with this? Thanks.

谁能帮我解决这个问题?谢谢。

采纳答案by Sumeet Gavhale

Ok, Create a page yourpage.html / yourpage.php whatever, you have to put all your pages in a folder in C:\Xampp\htdocs\ dir

好的,创建一个页面 yourpage.html / yourpage.php 无论如何,您必须将所有页面放在 C:\Xampp\htdocs\ 目录中的文件夹中

Then try accessing following url:

然后尝试访问以下网址:

localhost/yourpage.html

本地主机/您的页面.html

or

或者

localhost/yourpage.php

本地主机/您的页面.php

That should work.

那应该工作。

回答by Sandeep Kumar

I think you should be entering "http://localhost/index.php", because there is no such file in my ../htdocs/xampp/ folder called as index.php.

我认为您应该输入“ http://localhost/index.php”,因为在我的 ../htdocs/xampp/ 文件夹中没有这样的文件称为 index.php。

So may be the file you are referring to is in ../htdocs/index.php and to access it you need to hit the url as "http://localhost/index.php".

因此,您所指的文件可能位于 ../htdocs/index.php 中,要访问它,您需要将 URL 设为“ http://localhost/index.php”。

Thanks.

谢谢。