2015-01-18 4 views
4

어떻게이 오류를 해결할 수 있습니까?
file_get_contents(http://www.example.com/name/j/92801): failed to open stream: HTTP request failed! HTTP/1.1 416 Requested Range Not Satisfiable in line
다음은 PHP 파일 코드입니다.
echo $file = file_get_contents("http://www.example.com/name/j/92801");
나는 우선이 php.ini 파일에 allow_url_fopen을 사용할 수 있습니다 2.4HTTP 요청이 실패했습니다! HTTP/1.1 416 요청한 범위가 PHP 파일에 만족하지 않습니다.

+0

도움을 heres 조금 기능을 CURL을 사용하면이 어떤 도움이됩니다 http://webmasters.stackexchange.com/questions/17300/what-are-the-causes-of- a-416-error – RiggsFolly

+0

여기서 해결책을 찾을 수 없습니다. – Axeem

+0

문제는 example.com에 있었고 사이트/코드 또는 캐시에 없었을 가능성이 있습니다. – RiggsFolly

답변

0

서버 WAMP 사용하고? 와 더 나은 모든 초는 당신에게

function curl($url , $ua = FALSE){ 
      if($ua == false){ 
       $ua = $_SERVER['HTTP_USER_AGENT']; 
      } 
      $ch = curl_init(); 
      curl_setopt($ch , CURLOPT_URL , $url); 
      curl_setopt($ch , CURLOPT_RETURNTRANSFER , true); 
      curl_setopt($ch , CURLOPT_FOLLOWLOCATION , true); 
      curl_setopt($ch , CURLOPT_USERAGENT , $ua); 
      return curl_exec($ch); 
     } 
관련 문제