【发布时间】:2011-08-26 06:38:14
【问题描述】:
$page1 = file_get_contents('http://www.google.com');
$page2 = file_get_contents('http://localhost:8000/prueba');
当我回显结果时,它在 Google 上有效,但在我的网站上无效。当我把地址放在资源管理器上时。这发生在我在 django 制作的所有网站上。 :(
警告: file_get_contents(http://localhost:8000/prueba) [function.file-get-contents]: failed to open stream: 连接尝试失败,因为连接方在一段时间后没有正确响应,或者建立连接失败,因为连接主机未能响应。在 C:\xampp\htdocs\squirrelmail\plugins\captcha\backends\b2evo\b2evo.php 第 138 行
致命错误:第 138 行 C:\xampp\htdocs\squirrelmail\plugins\captcha\backends\b2evo\b2evo.php 中的最大执行时间超过 60 秒
【问题讨论】:
-
它检索什么?一个空字符串?
var_dump(get_headers('http://localhost:8000/prueba'));给了什么? -
致命错误:在第 138 行的 C:\xampp\htdocs\squirrelmail\plugins\captcha\backends\b2evo\b2evo.php 中,最大执行时间超过了 60 秒,执行时间太长,你是要获取 index(.html/.php) 文件的内容还是目录 prueba 的内容?
-
手动去localhost:8000/prueba真的有效吗?您是否使用本地测试系统?如果您在外部服务器上执行此操作,它将无法正常工作
-
你不应该使用这个函数来做这个。
-
我真正提出的是 php 中对我在 Django 中的站点的请求。我想获取我在 django 中创建的站点,并且目录 prueba 不存在,因为 django 与 php 不同