curl-and-php
Timeout Problem
Date: Wed, 19 Nov 2003 17:21:38 +0100
I have a payment script that works fine as long as the script doesn't run
longer than 5 Minutes. Just after 5 Minutes I get the following message:
HTTP request sent, awaiting response...
End of file while parsing headers.
Retrying.
The script is starting again and works fine.
Does anybody have an idea how to solve the problem?
The script starts with the wget program on a Apache/1.3.24 server, PHP
Version 4.2.1,
libcurl/7.10.1 OpenSSL/0.9.6g zlib/1.1.4 and uses a https connection.
Script:
function exec_connection_1($zeile){
//führt verbindung zum Server, return true bei Antwort sonst false
//Die funktion dientt als ersatz zur exec_connection($zeile)
//bei libcurl 7.2.1 (SSL 0.9.5) wenn das letzte Zeichen kommt nicht
durch.
if(TESTMODUS){
$this->ERRCOD='0'; $this->TNUM="Erfolg im Test-Modus";
return true;
}
$ch = curl_init($this->URL);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $zeile);
curl_setopt ($ch, CURLOPT_POSTFIELDSIZE, 1);
curl_setopt ($ch, CURLOPT_TIMEOUT, 60);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 0);// 0 - wichtig !!!!!
ob_end_clean();
ob_start();
curl_exec($ch);
$result=ob_get_contents();
ob_end_clean();
curl_close ($ch);
if(!$result) return false;
if(strstr($result,";"))list($this->ERRCOD, $this->TNUM) =
explode(';',$result);
else $this->ERRCOD = $result;
return true;
}
Thanks for your help and sorry for my bad english
Martin Brenner
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
Received on 2003-11-19