PHP fopen 警告

发布于 2024-07-21 06:27:44 字数 266 浏览 2 评论 0原文

$file = @fopen("http://ajax.htm","rb");

我在使用 fopen 时收到此错误,

Warning: fopen(xyz.htm): failed to open stream: HTTP request failed! 
in /home/user/public_html/aaa/ttt.php on line 8

这可能是什么原因?

$file = @fopen("http://ajax.htm","rb");

I am getting this error while using fopen

Warning: fopen(xyz.htm): failed to open stream: HTTP request failed! 
in /home/user/public_html/aaa/ttt.php on line 8

what could be the reason behind this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

旧梦荧光笔 2024-07-28 06:27:44

我要在这里冒险并建议问题出在 url 'http://ajax.htm '。

I am going to go out on a huge limb here and suggest the problem is the url, 'http://ajax.htm'.

愛放△進行李 2024-07-28 06:27:44

来自文档

如果 PHP 确定 filename 指定了已注册的协议,并且该协议已注册为网络 URL,则 PHP 将检查以确保 allow_url_fopen 已启用。 如果关闭,PHP 将发出警告并且 fopen 调用将失败。

编辑ajax.htm 不是有效的网址。

from docs:

If PHP has decided that filename specifies a registered protocol, and that protocol is registered as a network URL, PHP will check to make sure that allow_url_fopen is enabled. If it is switched off, PHP will emit a warning and the fopen call will fail.

edit: ajax.htm is not a valid url.

冷清清 2024-07-28 06:27:44
$file = @fopen("ajax.htm","rb");

我认为这是你的问题

https://www.php.net/function.fopen

$file = @fopen("ajax.htm","rb");

there is your problem i think

https://www.php.net/function.fopen

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文