2010-12-27 4 views
2

새 전용 서버에 연결되어 있고 컬 연결에 오류가 있습니다. cURL이 제공하는 호스트를 확인할 수 없습니다.

나는 시도 하나

$_h = curl_init(); 
curl_setopt($_h, CURLOPT_HEADER, 1); 
curl_setopt($_h, CURLOPT_RETURNTRANSFER, 1); 
curl_setopt($_h, CURLOPT_HTTPGET, 1); 
curl_setopt($_h, CURLOPT_URL, 'http://api.beatport.com/catalog/labels/detail?id=14248&format=json&v=1.0'); 
curl_setopt($_h, CURLOPT_DNS_USE_GLOBAL_CACHE, false); 
curl_setopt($_h, CURLOPT_DNS_CACHE_TIMEOUT, 2); 
var_dump(curl_exec($_h)); 
var_dump(curl_getinfo($_h)); 
var_dump(curl_error($_h)); 

그리고 난은 DNS에 문제가 될 수

bool(false) array(21) { ["url"]=> string(72) "http://api.beatport.com/catalog/labels/detail?id=14248&format=json&v=1.0" ["content_type"]=> NULL ["http_code"]=> int(0) ["header_size"]=> int(0) ["request_size"]=> int(0) ["filetime"]=> int(-1) ["ssl_verify_result"]=> int(0) ["redirect_count"]=> int(0) ["total_time"]=> float(0) ["namelookup_time"]=> float(0) ["connect_time"]=> float(0) ["pretransfer_time"]=> float(0) ["size_upload"]=> float(0) ["size_download"]=> float(0) ["speed_download"]=> float(0) ["speed_upload"]=> float(0) ["download_content_length"]=> float(-1) ["upload_content_length"]=> float(-1) ["starttransfer_time"]=> float(0) ["redirect_time"]=> float(0) ["certinfo"]=> array(0) { } } string(40) "Couldn't resolve host 'api.beatport.com'" 

있어? 내가 열

/etc/hosts 파일을하고 난 컬를 통해 검색 할 웹 사이트의 IP를 추가하고 일했다 :

해결!

+0

방화벽 문제 일 수 있습니다. 서버가 나가는 연결을 허용합니까? – Oli

+0

도메인에 핑을 시도 했습니까? 아웃 바운드 프록시 일 수 있습니까? 전에 아웃 바운드 보안을 위해 호스트에서이를 보았습니다. – Jakub

+0

그것은 smtp.com에 smtp relay를 아무런 문제없이 연결합니다. 어떻게하면 허용되는지 확인 할 수 있습니다. –

답변

3

코드는 정상입니다. 이것은 실제로 전용 서버의 DNS 구성 문제입니다. 호스팅 서비스가 발신 컬 연결을 허용하는지 확인하십시오.

+1

호스팅 서비스가 허용되면 수행 할 수있는 문제가 있습니까? –

2

코드 이그니 터 코드에서 동일한 문제가 발생했습니다.

내 서버가 디지털 오션에 호스트 확인할 수 없습니다. 내 솔루션은 서버를 다시 시작합니다. 그것은

서비스 아파치를 다시 시작

감사합니다 많이!

+0

명령 줄의 nslookup이 정상적으로 작동하는 동안 Curl이 호스트를 확인할 수 없습니다. apachectl 재시작 시도 - 작동하지 않았습니다. 아파치를 멈추고 다시 시작했다. 서비스 apache2를 다시 시작하면 apachectl이 다시 시작되는 것과 다를 것입니다. – NickSoft

+0

이것은 나를 위해 일했습니다. 감사 :) – Jajo

관련 문제