also ich weiß nicht ob das hier richtig ist, da ich aber nicht weiß, wo das Problem liegt, würde ich hier mal anfangen.
Ich habe einen Webservice (Java REST) auf einem Debian-Server (getestet mit Debian 7 und
![Cool 8)](./images/smilies/icon_cool.gif)
Nun habe ich den Webservice auf einen anderen Server (ebenfalls Debian) umgezogen. Den Service kann ich über URL im Browser problemlos ansprechen und bekomme die erwartete Antwort. Leider kommt auf der Webseite immer eine Fehlermeldung beim Aufbau mit curl. Ich habe nichts außer der Adresse des Servers geändert.
Beide Server sind mit Debian 64 Bit minimal installiert
Fehlermeldung: cURL Error (7): Failed to connect to port 8080: Connection refused
Code: Alles auswählen
$curl = curl_init();
//curl_setopt($curl, CURLOPT_URL, "[ALTER_SERVER]:8080/hgidataservice/hgidataservice/gameservice/gamepreview?nextDays=14");
curl_setopt($curl, CURLOPT_URL, "[NEUER_SERVER]:8080/hgidataservice/hgidataservice/gameservice/gamepreview?nextDays=14");
curl_setopt($curl, CURLOPT_HTTPGET, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_ENCODING, "UTF-8");
$curl_response = curl_exec($curl);
if ($curl_errno = curl_errno($curl)) {
$curl_error = curl_error($curl);
echo "cURL Error ($curl_errno): $curl_error<br><br>";
$info = curl_getinfo($curl);
curl_close($curl);
die('error occurred during curl exec. Additional info: ' . var_export($info));
}
Vielen Dank schon mal
Ausgabe curl_getinfo
Code: Alles auswählen
array ( 'url' => 'http://server-ip:8080/hgidataservice/hgidataservice/gameservice/gamepreview?nextDays=14', 'content_type' => NULL, 'http_code' => 0, 'header_size' => 0, 'request_size' => 0, 'filetime' => -1, 'ssl_verify_result' => 0, 'redirect_count' => 0, 'total_time' => 0.00010399999999999999, 'namelookup_time' => 2.5999999999999998E-5, 'connect_time' => 0, 'pretransfer_time' => 0, 'size_upload' => 0, 'size_download' => 0, 'speed_download' => 0, 'speed_upload' => 0, 'download_content_length' => -1, 'upload_content_length' => -1, 'starttransfer_time' => 0, 'redirect_time' => 0, 'certinfo' => array ( ), 'primary_ip' => '', 'primary_port' => 0, 'local_ip' => '', 'local_port' => 0, 'redirect_url' => '', )