I have a problem with a CURL request i make in php. The issue is that at random times it returns a timeout. What i noticed is that after i added custom error pages the 404 custom page works but the 408 page when done with curl returns nothing.
Example of 404 page: http://emailingrestauraweb.com/qweqwe
Below is my php code:
$strCookie = 'PHPSESSID=' . $this->SessionID;
$curl_log = fopen("curl.txt", 'w');
//Setup connection
$curl = curl_init();
curl_setopt_array($curl,array(
CURLOPT_URL => $URL,
CURLOPT_USERAGENT=>$this->UserAgent,
CURLOPT_POST =>true,
CURLOPT_POSTFIELDS => http_build_query($arrParams, null, '&'),
CURLOPT_COOKIE => $strCookie,
CURLOPT_COOKIESESSION=>1,
CURLOPT_HEADER => 1,
CURLOPT_VERBOSE => 0, // Logs verbose output to STDERR
CURLOPT_SSL_VERIFYPEER => 0, // Do not verify certificate
CURLOPT_TIMEOUT => 300,
CURLOPT_CONNECTTIMEOUT=>260,
CURLOPT_NOSIGNAL => 1,
CURLOPT_RETURNTRANSFER=>1
));
//Send request
$result_json = curl_exec($curl);
$error_code =curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
I tried everything i have no idea why this happens and it’s random too.
UPDATE 1
I run the scripts on 2 slicehost slices. I make a request from one slice to another to an api. The api is an OEMPRO software for sending emails.
I understand that 408 means timeout but this seems to random and most of the time it’s repetitive like a block and i’m wondering if this could be something that that software might use.
This issue happened after my domain where OEMPRO is running expired for like 3 days and then it went back and now i have this problem…
Thanks for all the answers.
You said your domain was expired for 3 days. There is a high probability that this was a DNS resolve issue. Give it 24-48 hours and let us know if there is any change.