Like people say, check with the configuration.
phpinfo.php
<?php
phpinfo();
?>
Search for OpenSSL on the webpage.
Also, don't forget to restart the WebServer after altering the php.ini file.
If you can't use file_get_contents(), use cURL instead if available, it's better in many ways and faster.
function url($url,$option = null) {
$cURL = curl_init();
if ($option) {
curl_setopt($cURL, CURLOPT_URL, $url.$option);
} else {
curl_setopt($cURL, CURLOPT_URL, $url);
}
curl_setopt($cURL, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($cURL, CURLOPT_AUTOREFERER, 1);
curl_setopt($cURL, CURLOPT_HTTPGET, 1);
curl_setopt($cURL, CURLOPT_VERBOSE, 0);
curl_setopt($cURL, CURLOPT_HEADER, 0);
curl_setopt($cURL, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($cURL, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($cURL, CURLOPT_SSL_VERIFYHOST, 1);
curl_setopt($cURL, CURLOPT_DNS_USE_GLOBAL_CACHE, 0);
curl_setopt($cURL, CURLOPT_DNS_CACHE_TIMEOUT, 2);
$output['page'] = curl_exec($cURL);
$output['contentType'] = curl_getinfo($cURL, CURLINFO_CONTENT_TYPE);
curl_close($cURL);
return $output;
}
$page = url('https://example.com/','i/like/subfolders');
phpinfo()
and looking for a line that reads:OpenSSL support enabled
? Should be under the headline "openssl". – Ghanaphp.ini
. Don't forget to restart Apache. – Buschiphp -i
(cli) orphpinfo()
(web) to see if the extension is actually enabled? Please post the results if you don't know how to see if it's enabled. – Hofmannsthal