file_get_contents方法获取https协议的地址报错。
file_get_contents(): SSL operation failed with code 1. OpenSSL Error message。
解决方法:
1,修改服务器相关配置。
如果你没权限。
$arrContextOptions=array(
"ssl"=>array(
"verify_peer"=>false,
"verify_peer_name"=>false,
),
);
$response = file_get_contents("https://gocn.me",false, stream_context_create($arrContextOptions));
未经允许不得转载:天宝寺||陈瑞轩 » file_get_contents(): SSL operation failed with code 1. OpenSSL Error message