내 웹 사이트에서 일부 HTTPS URL을 읽으려고하면 문제가 발생합니다.PHP 메소드로 HTTPS 링크 사용 (file_get_contents, getimagesize)
"http"를 사용하는 경우 문제가 없습니다 (file_get_contents 및 curl 사용). 그러나 "https"로 "http"를 다시 작성하면이 방법이 작동하지 않습니다.
내가 몇 가지 오류 얻을 : 브라우저에서failed to open stream: operation failed occured
Failed to enable crypto occured
SSL operation failed with code 1. OpenSSL Error messages: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
을, 모든 방법을 작동 : https://ssl10.ovh.net/~fyprbqhq/_perso/facebook.myclimb/test.php은 phpinfo에서
((디스플레이는 "OK"표시해야합니다)) 내가 가진 :
openssl
OpenSSL support enabled
OpenSSL Version OpenSSL 0.9.8c 05 Sep 2006
아이디어가있는 경우.
도움 주셔서 감사합니다.
(시 : get_headers() 내 경우에는 https로도 작동하지 않습니다)
상세 정보 :
file_get_contents :
$data = file_get_contents("https://ssl10.ovh.net/~fyprbqhq/_perso/facebook.myclimb/test.php");
말림 :
$curl_handle = curl_init();
curl_setopt($curl_handle, CURLOPT_URL, "http://ssl10.ovh.net/~fyprbqhq/_perso/facebook.myclimb/test.php");
curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT,2);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, false);
$data = curl_exec($curl_handle);
curl_close($curl_handle);
당신이 file_get_contents HTTP를 통해 작동하는지 확인입니까? fopen/curl에 대한 두 개의 개별 아이디어가 있지만 file_get_contents가 두 경우 모두 실패하는 경우에만 true입니다. :) 또한 다른 https URL로 시도 했습니까? – mishu
파일 내용을 다운로드하는 데 사용하는 줄을 넣을 수 있습니다. – ThoriumBR
다른 포럼에서 읽은 내용에 따르면, 예 file_get_contents가 작동해야합니다. 그러나 이러한 경우 (https), 나는 컬이 더 적절하다고 읽었다. 그럼에도 불구하고 Google https 링크를 읽으려고했는데 두 방법 모두에서 작동합니다. – F2000