简体   繁体   English

Xampp版本1.7.7的PHP代码不起作用

[英]Xampp version 1.7.7 php code doesn 't work

I have installed Xampp version 1.7.7 for windows and i want to start learning php. 我已经为Windows安装了Xampp版本1.7.7,我想开始学习php。 The problem here is I can 't run php code. 这里的问题是我无法运行php代码。

I tried this very simple example 我尝试了这个非常简单的例子

<html>
<head>
<title>Hello world!</title>
</head>
<body>
    <?php echo "Hello world!"; ?>
</body>
</html>

Ofcorse I don t double click the php file and I don t just execute it in Firefox. Ofcorse我不会双击php文件,而不仅仅是在Firefox中执行它。 I go to 我去

 http://localhost/xampp/htdocs/helloworld.php

which is the correst direction, I have checked it several times. 这是最接近的方向,我已经检查了好几次了。 I tried for index.php too but it doesn 't work too. 我也尝试过index.php,但它也不起作用。 I get this error. 我得到这个错误。

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
05/21/12 15:17:22
Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4   
Perl/v5.10.1

I have installed Xampp with default options and when i click on admin (xampp xontrol panel) I get the classic orange page. 我已经用默认选项安装了Xampp,当我单击admin(xampp xontrol面板)时,我得到了经典的橙色页面。 When I go on status menu it shows that everything is activated except SMTP service and Tomcat service. 当我进入状态菜单时,它显示除SMTP服务和Tomcat服务以外的所有内容均已激活。 I have tried to uninstall and reinstall xampp and nothing changed. 我尝试卸载并重新安装xampp,但没有任何更改。

I have also searched on the web but nothing seems to help. 我也在网上搜索,但似乎无济于事。 Thank you 谢谢

Try 尝试

http://localhost/helloworld.php

if you save the file at xampp/htdocs/ 如果将文件保存在xampp / htdocs /

尝试http:// localhost / helloworld.php C:... \\ xampp \\ htdocs \\是您的文档根目录,因此服务器从此文件夹中获取文件,并且Firefox可以通过http:// localhost / file访问它们.php文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM