当前位置:首页 > PHP >

file_get_contents(): SSL operation failed with code 1

时间:2021-06-16 23:28:37浏览:5161 转载

出现file_get_contents(): SSL operation failed with code 1的错误

方法需要添加参数,如下:


$stream_opts = [
    "ssl" => [
        "verify_peer"=>false,
        "verify_peer_name"=>false,
    ]
];  
 
$response = file_get_contents("https://www.yourdomain.com",false, stream_context_create($stream_opts));



上一篇:Python爬虫支持的网页解析技术有几种?这几种技术有什么特点?
下一篇:Python实现简单HTTP服务器

发表评论

昵称:  验证码:

关于博主

博主

博主:BlueCode

职业:web程序

简介:2002年开始一直从事Web制作,网站运营,会PHP+MYSQL ASP+MSSQL,微信开发