XK8ER
asked on
error allowed memory size
hello there,
I keep getting this error after a while of scanning the pages of my forum for working links..
the line 79 is $pagel = curl_exec($ch); which i posted the function bellow
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 39472634 bytes) in /var/www/html/file.php on line 79
I keep getting this error after a while of scanning the pages of my forum for working links..
the line 79 is $pagel = curl_exec($ch); which i posted the function bellow
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 39472634 bytes) in /var/www/html/file.php on line 79
function curl($link, $post='0')
{
global $pagel;
if($fgc == 1)
{
file_get_contents($link);
}
else
{
$ch = curl_init($link);
curl_setopt($ch, CURLOPT_URL, $link);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 20);
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
if(eregi("megashares\.com" , $link))
{
$strCookie = realpath(dirname($_SERVER['SCRIPT_FILENAME'])) . "/cookies.txt";
curl_setopt($ch, CURLOPT_COOKIE, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, $strCookie);
curl_setopt($ch, CURLOPT_COOKIEFILE, $strCookie);
}
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
if($post != '0')
{
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
}
$pagel = curl_exec($ch);
return($pagel);
curl_close($ch);
unset($pagel);
unset($ch);
}
}
remember to restart the web server IIS or Apache
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
"Set the memory limit to a higher value in php.ini "