今天跑之前写的一个采集,提示错误:
file_get_contents(): SSL operation failed with code 1. OpenSSL Error message
在file_get_contents前面加个配置,忽略证书验证即可。主要这里是采集,没必要做证书校验。
调整后代码:
$option=array('ssl'=>array('verify_peer' => false,'verify_peer_name' => false));
$html = file_get_contents($rd['content_url'],false,stream_context_create($option));