php 在 xampp 中找不到对象
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18580329/
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
Object not found in xampp
提问by Hasib Hasan
I have got a problem using xampp. I hope u guys are able to solve it.
我在使用 xampp 时遇到了问题。我希望你们能够解决它。
When i type in the address "localhost" it just shows "It works". But when i type "localhost/xampp" then it takes me to the welcome page of xampp. Why is that when everybody gets that just typing "localhost"?
I created a simple php hello world program to test under the folder htdocs and named it test.php. Then when i type in "localhost/xampp/test.php" it shows the message shown below-
当我输入地址“localhost”时,它只显示“它有效”。但是当我输入“localhost/xampp”时,它会将我带到 xampp 的欢迎页面。为什么当每个人都只输入“本地主机”时?
我在文件夹 htdocs 下创建了一个简单的 php hello world 程序进行测试,并将其命名为 test.php。然后当我输入“localhost/xampp/test.php”时,它会显示如下所示的消息-
Object not found!
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster. Error 404 localhost 9/3/2013 2:23:28 AM Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1
未找到对象!
在此服务器上找不到请求的 URL。如果您手动输入了 URL,请检查您的拼写并重试。
如果您认为这是服务器错误,请联系网站管理员。错误 404 localhost 9/3/2013 2:23:28 AM Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-2009011 mod_ssl/2.7。 2.0.4 Perl/v5.10.1
What should i do?
我该怎么办?
回答by wesley luan
Check if in httpd.conf file the DocumentRoot param is pointing to the folder htdocs.
检查 httpd.conf 文件中的 DocumentRoot 参数是否指向文件夹 htdocs。
回答by Favn Hghksd
I had the same problem but no where did I find a solution.
The solution is actually quite trivial, silly even :)
我遇到了同样的问题,但没有找到解决方案。
解决方案实际上很简单,甚至很愚蠢:)
I wrote my hello world file in notepad and when saving I typed: test.php
我在记事本中写了我的 hello world 文件,并在保存时输入:test.php
but I failed to change the "save as type" option from "Text Document" to "All Files".
但我未能将“保存类型”选项从“文本文档”更改为“所有文件”。
Yup, that's it and it worked!
是的,就是这样,它奏效了!
I am assuming you have already found your solution. I hope this helps somebody.
我假设您已经找到了解决方案。我希望这对某人有帮助。
回答by Shree Krrishna
ANSWER
回答
just simply set the path as http:// localhost/project_folder or file_name
只需简单地将路径设置为 http://localhost/project_folder 或 file_name
NOTE:
笔记:
no need to put http:// localhost /xampp/htdocs/project_folder or file_name-ERROR
无需放置 http:// localhost /xampp/htdocs/project_folder 或 file_name-错误