简体   繁体   English

无法使用XAMPP和PHP访问服务器

[英]Cannot access the server using XAMPP and PHP

I'm brand new today to using PHP but I can't get anything showing on the page. 我今天是使用PHP的新手,但是页面上什么也没显示。 I've installed XAMPP, started the server, mounted the volume and created a new file, index.php, which I've moved into a new folder called scripts inside htdocs. 我已经安装了XAMPP,启动了服务器,安装了卷,并创建了一个新文件index.php,并将其移到htdocs中一个名为scripts的新文件夹中。 Based on the articles I've been following this should give me output at localhost/scripts/index.php but it is only giving me the 'requested URL not found on this server' response (I'm just running a basic echo 'hello world' line). 根据我一直关注的文章,这应该给我在localhost / scripts / index.php上的输出,但这只是给我“在此服务器上找不到的请求的URL”响应(我只是在运行基本回显“你好”世界线)。 Thanks for any help. 谢谢你的帮助。

Going to just http://localhost shows the 'It works!' 仅访问http:// localhost即可显示“有效!” message but nothing else. 消息,但没有别的。

在此处输入图片说明

Check if there are any processes running on port 80, if you have skype or torrent client please close them and try restarting xampp. 检查端口80上是否正在运行任何进程,如果您有skype或torrent客户端,请关闭它们并尝试重新启动xampp。

Also check if it running on your IP Address. 还要检查它是否在您的IP地址上运行。 open command prompt and type ipconfig for windows and ifconfig for mac. 打开命令提示符,为Windows输入ipconfig ,为mac输入ifconfig once you get your ip address type it in the browser and see if you can find the server running. 一旦获得IP地址,请在浏览器中键入它,然后查看是否可以找到正在运行的服务器。

Try to save the file with correct extension ie .php just typing .php at the end sometimes doesn't work. 尝试以正确的扩展名保存文件,即.php,只是在末尾键入.php有时不起作用。

Try to do this, 1. Add double inverted commas "" 2. File Save as Type - All Files 3. add .php at the end of your filename 尝试执行以下操作:1.添加双引号“” 2.将文件另存为类型- 所有文件 3.在文件名末尾添加.php 检查红色引号

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

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