Home  >  Article  >  Backend Development  >  新手请问,php+apache访问本地网页的有关问题

新手请问,php+apache访问本地网页的有关问题

WBOY
WBOYOriginal
2016-06-13 12:53:27802browse

新手请教,php+apache访问本地网页的问题
我搭建了php+apache+mysql,在站点目录下用记事本写了一个html改名为fist.php,然后在浏览器里访问http://localhost/first.php,报错如图。(站点里还有一个index.php可以访问如图2)
问:
first.php的代码如下


 hi!


北京







index.php的代码如下

    phpinfo();
?>

1、编写的网页是否放在站点目录下,
2、如何在php里写一个网页,然后用浏览器去访问。
php
------解决方案--------------------
访问路径不对...
------解决方案--------------------
放到网站主目录下即可
------解决方案--------------------
把 php 文件放在htdocs目录下
打印phpinfo();
------解决方案--------------------
引用:
引用:访问路径不对...
http://localhost/first.php 不对吗?请问怎样才是对的?我的first.php是放在目录C:apache/htdocs下的
而#2显示 网站主目录 是 D:/websit/PHPnow-1.5.6/htdocs
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn