问题
I've tried running the next code on xampp :
$url2="https://....";
$content=file_get_contents($url2);
and that's the error I've got :
Warning: file_get_contents() [function.file-get-contents]: Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in C:\xampp\htdocs\whoTalk\sys\user.php on line 38
What do I have to do in order to be able to get contents of a url which a https:// wrapper?
Thanks in advance
回答1:
In your php.ini search for the following:
extension=php_openssl.dll
If it is there and commented, uncomment it. If it is not there, add it :-)
回答2:
in WAMP I added
allow_url_include = On
extension=php_openssl.dll
extension=php_curl.dll
to all 3 php.ini files I could find, namely
\wamp\bin\php\php5.4.12\php.ini
\wamp\bin\php\php5.4.12\phpForApache.ini
\wamp\bin\apache\Apache2.4.4\bin\php.ini
I don't know which specific settings in which .ini file is actually needed, but https is accepted now....
回答3:
You would need to have the OpenSSL extension for PHP enabled in XAMPP to grab anything from a secure server.
来源:https://stackoverflow.com/questions/11453487/xampp-and-file-get-contentshttps