运行PHP时无法连接到本地主机 [英] Unable to connect to local host when running PHP
问题描述
我正在尝试学习PHP并将Netbeans与PHP插件一起用作我的IDE,但是问题是当我运行脚本时,我的浏览器(Firefox)无法连接到本地主机.
I am trying to learn PHP and use Netbeans as my IDE along with a PHP plug-in, but the problem is that when I run the script, my browser (Firefox) couldn't connect to localhost.
我的代码是对当前PHP信息的简单查询.
My code is a simple query to my current PHP information.
<?php
phpinfo();
?>
这是我尝试访问的地址:
This is the address I'm trying to access:
http://localhost/PhpProject1/index.php
推荐答案
在xampp/htdoc文件夹中创建一个文件夹PhpProject1.假设您已将xampp安装在c驱动器根目录下,则文件夹结构将为c:/xampp/htdoc/PhpProject1/并将index.php放入其中,之后您可以添加任何php代码,即
Create a folder PhpProject1 in xampp/htdoc folder. Suppose you have installed xampp at c drive root then folder structure will be c:/xampp/htdoc/PhpProject1/ and place index.php it it, after that you may add any php code i.e
<?php
phpinfo();
?>
希望这是您的问题的答案.保重
Hopefully this is the answer of your question. Takecare
这篇关于运行PHP时无法连接到本地主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!