Curl connection issue
Hi guys, im new in the forum and a granpa in Cpanel. i have a dedicated running proxmox with 2 VPS in there both with WHM Cpanel. im using CSF as firewall in both servers and the proxmox firewall disabled at the moment. in one of the servers i have WHMCS billling and automation script. i run a curl connection from server A (that has the WHMCS) to itself and works just fine, when i run the same curl to the server B then i get connection Curl Error: Failed to connect to :2087, Network is unreachable, where = my server IP and 2087 the port. Everything works just fine from the browser, ips are in Whitelist in cphulk and all allowed in both CSF.
here is a test script i wrote to make sure the issue is not from WHMCS:
i run this script in both servers trying to o a test but no luck. Please NOTE that curl is installed in both servers. I really need some assistant here cause im losing my mind!
:2087";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $whmcsurl);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($ch);
if (curl_error($ch)) {
echo "Curl Error: ".curl_error($ch)."
";
} elseif (!$data) {
echo "Empty Data Response - Please check CURL Installation
";
}
curl_close($ch);
echo "Connection Response (this should be a response from $whmcsurl when working correctly):
$data";
?>
i run this script in both servers trying to o a test but no luck. Please NOTE that curl is installed in both servers. I really need some assistant here cause im losing my mind!
-
Hi, Please try to curl verbose option while running the script to see were exactly it is getting broken, curl -v or curl --trace filename Regards, 0 -
when i run the same curl to the server B then i get connection Curl Error: Failed to connect to :2087, Network is unreachable, where = my server IP and 2087 the port
Hello, You can try verifying the connection from the ServerA to ServerB completes successfully using telnet. For example, you'd run a command like this from ServerA:telnet serverB 2087
Thank you.0
Please sign in to leave a comment.
Comments
2 comments