tumblr에 대한 블로그가 있는데 php 및 tumblrs API를 통해 액세스하려고합니다.file_get_contents failed
http://blog.example.com/api/read/json?start=0&num=10&debug=1
그것은 잘 작동하는 것 같다 :
API를 엔드 포인트입니다.
그러나, 내가 할 때
$result = file_get_contents("http://blog.example.com/api/read/json?start=0&num=10&debug=1");
print_r($result);
브라우저는이 또한 컬 실패
Warning: file_get_contents() [function.file-get-contents]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /path/to/file/test.php on line 5
Warning: file_get_contents(http://blog.example.com/api/read/json?start=0&num=10&debug=1) [function.file-get-contents]: failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /path/to/file/test.php on line 5
를 출력합니다.
아이디어가 있으십니까?
내 블로그가 하위 도메인에 있다는 사실과 관련이 있다고 생각합니다. 내가 이것을 말하는 이유는 루트 URL에있는 블로그에서 동일한 스크립트를 실행하면 잘 작동합니다. 하위 도메인을 탈출 할 수있는 올바른 방법이 있습니까?
무슨 메시지가 울리나요? ('curl_error()'를 사용하여 출력하십시오.) –
이것은'willium.com'이이 스크립트를 실행중인 컴퓨터에 의해 해결되지 않을 가능성이 높다는 것을 의미합니다. –
내 블로그가 하위 도메인에 있다는 사실과 관련이 있다고 생각합니다. 내가 이것을 말하는 이유는 루트 URL에있는 블로그에서 동일한 스크립트를 실행하면 잘 작동합니다. 하위 도메인을 탈출 할 수있는 올바른 방법이 있습니까? – willium