Hello Everyone,

Can somebody help me with my code using curl for I am encountering this error:

PHP Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 16677 bytes) in /mango/Webserver/html/gemar/irdget.php on line 91
You have new mail in /var/spool/mail/gemar

My curl function looks like this:
function Curl($url){
global $ch,$data;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT,3600);

	   $data = curl_exec($ch); 
	   if (curl_errno($ch)) {
	       print curl_error($ch);
		   exit();
       } else {

	   }
	   curl_close($ch);	
	}

But the error line has this code:

$strTempA = substr($strTemp,$pos_first,$TempLen);

Can you please give me an idea on how to solve this :o

Thanks,
Mhar

    5 days later

    I encountered a new error after executing the function severals times maybe three hundred times or more. The script hangs. I even added this line:

    ini_set('max_execution_time', '120');

    Please help here...... :o

      What's the "new error"? Does it say that the script ran out of time? Try resetting the maximum execution time (you can use ini_set or [man]set_time_limit[/man]) inside this (presumably slow) function that you're executing several hundred times. That way the function will be getting just a little bit extra time to run every time it's executed.

        Write a Reply...