Ich bin auf meinem neuen dedizierten Server, und ich bekomme Fehler bei Verbindungen curl.cURL gibt Host konnte nicht aufgelöst werden
Ich habe versucht, dass ein
$_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));
und ich habe
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'"
, dass ein DNS-Problem sein kann?
GELÖST:
i geöffnet/etc/hosts und hinzugefügt, um die IP der Website, die ich über curl abrufen möchten und es funktionierte!
Könnte ein Firewall-Problem sein..ist Ihr Server erlaubt, ausgehende Verbindungen zu machen? – Oli
haben Sie versucht, die Domain zu pingen? Könnte outbound Proxy sein? Ich habe das schon vorher auf Hosts für ausgehende Sicherheit gesehen. – Jakub
verbindet es smtp.com für SMTP-Relays ohne Probleme, wie kann ich überprüfen, ob es zulässig ist –