我已经为Windows安装了Xampp 1.7.7版本,我想开始学习php.这里的问题是我无法运行php代码.
我试过这个非常简单的例子
<html>
<head>
<title>Hello world!</title>
</head>
<body>
<?php echo "Hello world!"; ?>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
Ofcorse我没有双击php文件而我只是在Firefox中执行它.我去
http://localhost/xampp/htdocs/helloworld.php
Run Code Online (Sandbox Code Playgroud)
这是最正确的方向,我已经多次检查过了.我也尝试过index.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
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
Run Code Online (Sandbox Code Playgroud)
我已经安装了Xampp默认选项,当我点击admin(xampp xontrol面板)时,我得到了经典的橙色页面.当我进入状态菜单时,它显示除SMTP服务和Tomcat服务之外的所有内容都已激活.我试图卸载并重新安装xampp并没有改变.
我也在网上搜索过,但似乎没有任何帮助.谢谢
小智 6
尝试
http://localhost/helloworld.php
Run Code Online (Sandbox Code Playgroud)
如果您将文件保存在xampp/htdocs /