Method One:
In PHP, the Web site that captures HTTPS prompts the following error content:
Warning:file_get_contents () [function.file-get-contents]: Failed to open stream:invalid argument into i:webmyphpa.php on L INE 16
Open php.ini file Find; extension=php_openssl.dll, remove double quotes ";", restart the Web server.
Apache server, you can enable MOD_SSL module testing at the same time.
If it is not convenient to modify the server configuration, you can refer to the following functions to resolve:
code example:
<?php
//file_get_contents capture HTTPS address content
function Getcurl ($url) {
$ch = Curl_init ();
curl_setopt ($ch, Curlopt_url, $url);
curl_setopt ($ch, curlopt_returntransfer,1);
curl_setopt ($ch, Curlopt_ssl_verifypeer, false);
curl_setopt ($ch, Curlopt_ssl_verifyhost, false);
$result = curl_exec ($ch);
Curl_close ($ch);
return $result;
}
Method Two:
In PHP, an error warning similar to the following occurs when you use the File_get_contents function to crawl the content of a Web page that is the beginning of https with the URL:
Warning:file_get_contents (https://127.0.0.1/index.php) [function.file-get-contents]: failed to open stream:invalid Argument in E:\website\blog\test.php on line 25
Open php.ini Find; extension=php_openssl.dll, remove double quotes ";", restart the Web server.
Apache can enable MOD_SSL module test at the same time
The above content to share two ways to solve PHP file_get_contents function crawl HTTPS address error, I hope to help.