Not sure why but I just can't get access on a cpanel account that is located on a vps.
This works on my other servers
I tried the sample code as well
But both give me an error 7 "Can't connect to host"
My only guess left now is that it might be a firewall setting. If so is it something I can bypass or do i need to ask the hosting company to turn of the blocking?
Edwin
This works on my other servers
PHP:
$Curl = curl_init();
curl_setopt($Curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($Curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($Curl, CURLOPT_REFERER, $reffer);
curl_setopt($Curl, CURLOPT_USERAGENT, $agent);
curl_setopt($Curl, CURLOPT_URL, $cpanel_url);
curl_setopt($Curl, CURLOPT_USERPWD, $username.':'.$password);
curl_setopt($Curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($Curl,CURLOPT_SSL_VERIFYHOST,0);
$Output = curl_exec($Curl);
$end_url = curl_getinfo($Curl, CURLINFO_EFFECTIVE_URL);
PHP:
$curl = curl_init();
# Create Curl Object
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER,0);
# Allow self-signed certs
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST,0);
# Allow certs that do not match the hostname
curl_setopt($curl, CURLOPT_HEADER,0);
# Do not include header in output
curl_setopt($curl, CURLOPT_RETURNTRANSFER,1);
# Return contents of transfer on curl_exec
$header[0] = "Authorization: Basic " . base64_encode($username.":".$password) . "\n\r";
curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
# set the username and password
curl_setopt($curl, CURLOPT_URL, $end_url);
# execute the query
$result = curl_exec($curl);
if ($result == false) {
error_log("curl_exec threw error \"" . curl_error($curl) . "\" for $query");
# log error if curl exec fails
}
curl_close($curl);
My only guess left now is that it might be a firewall setting. If so is it something I can bypass or do i need to ask the hosting company to turn of the blocking?
Edwin