file_get_contents https ssl 错误
<本文原载于www.forasp.cn>
在做php 远程获取 https 内容时,提示报错 [function.file-get-contents]: failed to open stream: Invalid argument
%77w%77%2E%66%6F%72%61%73%70%2E%63%6E
在做php 远程获取 https 内容时,提示报错 [function.file-get-contents]: failed to open stream: Invalid argument
网上找了额一下解决方案如下:
1.打开php.ini文件,extension=php_openssl.dll去掉前面的分号,allow_url_include = off改为allow_url_include = On,
2.通过php代码实现
<?php
$option=array(
"ssl"=>array(
"verify_peer"=>false,
"verify_peer_name"=>false,
),
);
$response = file_get_contents("https://xxx.com/xxx.html", false, stream_context_create($option));
echo $response;
?>
原文:https://www.cnblogs.com/devcjq/articles/9250800.html
%77w%77%2E%66%6F%72%61%73%70%2E%63%6E