【发布时间】:2015-05-15 05:04:37
【问题描述】:
所以我在同一个目录中有一个 index.php 文件和一个 scrapper.php 文件。 我在该目录中使用我的 mac 终端,然后启动 php -S localhost:8888。 当我访问 localhost:8888 时,会显示 index.php。太棒了。
但是,我也想在浏览器中查看 scraper.php 文件,但我不知道如何操作。 请帮我。 到目前为止,我已经尝试过:
http://localhost:8888/scraper (仅显示我的 index.php)。
我也加入了
<?php include("./scraper.php"); ?>
在我的 index.php 中。
我可以在终端中看到交互: [2015 年 5 月 14 日星期四 21:57:43] 127.0.0.1:60411 [200]: /background.jpg [2015 年 5 月 14 日星期四 21:57:45] 127.0.0.1:60416 [200]: /scraper
但是现在浏览。 请帮忙。
【问题讨论】:
-
你试过-
http://localhost:8888/scraper.php吗? -
<?php include(__DIR__ . "/scraper.php"); ?>怎么样 -
ttp://localhost:8888/scraper.php 成功了!谢谢