file_get_contents () Get HTTPS this error unable to find the wrapper "https" –did

Source: Internet
Author: User

file_get_contents () Get HTTPS this error unable to find the wrapper "https" –did

Workaround one, if you are using the server, you can refer to this method, modify the PHP configuration file (win host) to support HTTPS

Find and modify in php.ini

Extension=php_openssl. DLL     = On

Restart the service can be, if you are Linux server,Linux under the PHP, you must install the OpenSSL module, installed in the future can be visited.

Workaround two, if you are not using the server, you use the host, you cannot change the configuration of PHP, you can use the Curl function to replace the file_get_contents function, of course your host must support the Curl function.

<?PHPfunctionGetsslpage ($url) {$ch=curl_init (); curl_setopt ($ch, Curlopt_ssl_verifypeer,FALSE); curl_setopt ($ch, Curlopt_header,false); curl_setopt ($ch, Curlopt_followlocation,true); curl_setopt ($ch, Curlopt_url,$url); curl_setopt ($ch, Curlopt_referer,$url); curl_setopt ($ch, Curlopt_returntransfer,TRUE);$result= Curl_exec ($ch); Curl_close ($ch);return $result;}EchoGetsslpage ($_get[' URL ']);?>

file_get_contents () Get HTTPS this error unable to find the wrapper "https" –did

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.