Home > Backend Development > PHP Tutorial > Solution to the error of grabbing https address by file_get_contents function in PHP (two methods), burpsuite grabbing https_PHP tutorial

Solution to the error of grabbing https address by file_get_contents function in PHP (two methods), burpsuite grabbing https_PHP tutorial

WBOY
Release: 2016-07-12 09:08:04
Original
1164 people have browsed it

Solution to the error of grabbing https address by file_get_contents function in PHP (two methods), burpsuite grabbing https

Method 1:

In php, when crawling https websites, the following error content is prompted:

Warning: file_get_contents() [function.file-get-contents]: failed to open stream: Invalid argument in I:Webmyphpa.php on line 16

Open the php.ini file and find ;extension=php_openssl.dll. Remove the double quotes ";" and restart the web server.

For apache server, mod_ssl module testing can be enabled at the same time.

If it is inconvenient to modify the server configuration, you can use the following function to solve the problem:

Code example:

<&#63;php
//file_get_contents抓取https地址内容
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;
}
Copy after login

Method 2:

In PHP, when using the file_get_contents function to capture the content of a website whose URL starts with https, an error warning similar to the following will appear:

Warning: file_get_contents(https://127.0.0.1/index.php) [function.file-get-contents]: failed to open stream: Invalid argument in E:websiteblogtest.php on line 25

Open php.ini and find ;extension=php_openssl.dll. Remove the double quotes ";" and restart the web server.

Apache can enable mod_ssl module testing at the same time

The above content has shared with you two methods to solve the error of grabbing https address in PHP file_get_contents function. I hope it will be helpful to everyone.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1057472.htmlTechArticleSolution to the error in file_get_contents function grabbing https address in PHP (two methods), burpsuite grabbing https method one : In php, when crawling https websites, the following error content is prompted: ...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template