i call a CURL
code for calling a URL (the URL sends an email).
When i call the URL from the browser, it works, but when i execute it from the curl php code, it doesn't work.
also, the exact same curl code works on my https SSL production server, but not on my http development server.
The error i get on my development http server is "couldn't connect to host".
This is the code:
$ch = curl_init();
$requestedUrl = http://XXX.XXX.XX.XX/myproject/index.php?entryPoint=viewReport&record=.....etc..
curl_setopt($ch, CURLOPT_URL, $requestedUrl);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data = curl_exec($ch);
if ($data === FALSE) {
$GLOBALS['log']->fatal("error = " . print_r(curL_error($ch),true));
}
curl_close($ch);
i read every post there is on this issue. i don't know if i'm behind proxy or not and i dont know how to get the ip of the proxy if i'm behind one.
i have tried adding curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
tried adding :
curl_setopt($ch, CURLOPT_PROXYTYPE, 'HTTP');
curl_setopt($ch, CURLOPT_PROXY, "http://XXX.XXX.XX.XX"); //your proxy url
curl_setopt($ch, CURLOPT_PROXYPORT, "80"); // your proxy port number
tried opeining port 1080 in the firewall (which is open for any http address).
i'm out of ideas, so please help me :)