CodeIgniter Forums
Error using XMLRPC, CURL and file_get_contents - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: Error using XMLRPC, CURL and file_get_contents (/thread-45874.html)

Error using XMLRPC, CURL and file_get_contents - El Forum - 10-10-2011

We are having a problem getting a reliable response from the domain in CURL or File_Get_Contents below which uses CI to query a database.

More often than not it returns a error 52, or using file_get_contents a HTTP failed message.

If we switch the domain to the commented out code, it will load the page and pass it through curl / fgc. It is only when it has to go through CI's URL that there is a problem, sometimes it works but most of the time it doesn't

$code = 26003;
$curl = curl_init();  
curl_setopt($curl, CURLOPT_VERBOSE, true);

curl_setopt($curl, CURLOPT_URL, ''.$code);  
// curl_setopt($curl, CURLOPT_URL, '');  
//curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
curl_setopt($curl, CURLOPT_HEADER, 0);  // ignore any headers

curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_TIMEOUT, 30);

$store = curl_exec($curl);
print "<pre>";
print $store;
echo "\n\ncURL error number:" .curl_errno($curl);
// print error info
echo "\n\ncURL error:" . curl_error($curl);
print "</pre>";