php-[function.fopen]:无法打开流:HTTP请求失败! HTTP / 1.1 401未经授权

[function.fopen]:打开流失败:HTTP请求失败! HTTP / 1.1 401未经授权

我定期收到此错误,即仅在随机时间发生,任何想法会导致此错误,我已经检查了我的php.ini并将allow_url_fopen设置为true.

解决方法:

10.4.2 401 Unauthorized

The request requires user
authentication. The response MUST
include a WWW-Authenticate header
field (section 14.47) containing a
challenge applicable to the requested
resource. The client MAY repeat the
request with a suitable Authorization
header field (section 14.8). If the
request already included Authorization
credentials, then the 401 response
indicates that authorization has been
refused for those credentials. If the
401 response contains the same
challenge as the prior response, and
the user agent has already attempted
authentication at least once, then the
user SHOULD be presented the entity
that was given in the response, since
that entity might include relevant
diagnostic information. HTTP access
authentication is explained in “HTTP
Authentication: Basic and Digest
Access Authentication” [43].

Status Code Definitions

上一篇:PHP控制台脚本/传递默认参数/重构fopen()fread()fwrite()fclose()


下一篇:在PHP中使用fopen()创建文件时的默认权限是什么?