出现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.example.com",
               false, stream_context_create($stream_opts));

解決方法參考:

  1. file_get_contents(): SSL operation failed with code 1. And more
  2. ile_get_contents SSL operation failed with code 1 SSL3_GET_SERVER_CERTIFICATE certificate verify failed

相关文章:

  • 2021-06-07
  • 2021-10-09
  • 2021-06-18
  • 2021-07-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-16
  • 2021-06-27
  • 2022-12-23
  • 2021-10-15
  • 2022-02-01
  • 2021-06-17
相关资源
相似解决方案