hi i am getting these errors with my sites.. i am using sea script...
""Fatal error: Out of memory (allocated 524288) (tried to allocate 311296 bytes) in /home/xxxx/public_html/domain/Downloads/index.php on line 345"""
How to fix this error?
Started on the old forum in April 2012 · view the original in the archive · old links redirect here
hi i am getting these errors with my sites.. i am using sea script...
""Fatal error: Out of memory (allocated 524288) (tried to allocate 311296 bytes) in /home/xxxx/public_html/domain/Downloads/index.php on line 345"""
How to fix this error?
sounds like you have got an infinitive loop on line 345 of index.php
without seeing the script thats as far as we can help you unless someone else has experenced it with same script as you
lovebirds143 wrote: hi i am getting these errors with my sites.. i am using sea script...
""Fatal error: Out of memory (allocated 524288) (tried to allocate 311296 bytes) in /home/xxxx/public_html/domain/Downloads/index.php on line 345"""
How to fix this error?
Put
ini_set('memory_limit', '2000M');
something else wrote: sounds like you have got an infinitive loop on line 345 of index.php
without seeing the script thats as far as we can help you unless someone else has experenced it with same script as you
<?php
#-------------#
require 'moduls/ini.php';
require 'moduls/fun.php';
require 'moduls/connect.php';
require 'online.php';
//require 'moduls/header.php';
session_name('SID') ;
###############S?SuN?SlSl###############
if(session_start()){
if(!empty($_SESSION["onpage"]) AND !empty($_GET['onpage'])){
$_SESSION["onpage"]=$_GET['onpage'];
}
elseif(empty($_SESSION["onpage"]) AND !empty($_GET['onpage']))
{
$onpage=$_GET['onpaget'];
session_register ("onpage") ;
}
if(!empty($_SESSION["prew"]) AND !empty($_GET['prew']))
$_SESSION["prew"]=$_GET['prew'];
elseif(empty($_SESSION["prew"]) AND !empty($_GET['prew']))
{
$prew=$_GET['prew'];
session_register ("prew") ;
}
if(!empty($_SESSION["sort"]) AND !empty($_GET['sort']))
$_SESSION["sort"]=$_GET['sort'];
elseif(empty($_SESSION["sort"]) AND !empty($_GET['sort']))
{
$sort=$_GET['sort'];
session_register ("sort") ;
}
}
###############SzS'SLSlS?###############
$error = false;
if($_SESSION['autorise'] != $setup['password']){
$error = true;
}
if($_SESSION['ipu'] != clean($ip)){
$error = true;
}
###############SzNESlS2SuNESaSz SzSuNESuSLSuS?S?N<Na###############
$onpage = intval($_SESSION["onpage"]);
$prew = intval($_SESSION["prew"]);
$sort = get2ses('sort');
$id = intval($_GET['id']);
if (!empty ($_POST['page']))
{
$page = intval($_POST['page']);}
else {$page = intval($_GET['page']);}
$start = intval($_GET['start']);
if($onpage < 3){
$onpage = 10;
}
if($prew != 0 and $prew != 1){
$prew = $setup['preview'];
}
$valid_sort = array('name' => '','data' => '','load' => '','size' => '','eval' =>'');
if(!isset($valid_sort[$sort])){
$sort='name';
}
$MODE = '`priority` DESC,`name` ASC';
if($sort == 'data') $MODE = '`priority` DESC,`timeupload` DESC';
elseif($sort == 'size') $MODE = '`priority` DESC,`size` ASC';
elseif($sort == 'load') $MODE = '`priority` DESC,`loads` DESC';
elseif($sort == 'eval' && $setup['eval_change']) $MODE = '`priority` DESC,`yes` DESC ,`no` ASC';
###############SzSlS"N?N?SzSuSL N,SuSaN?NeSlSa SaSzN,SzS"SlS"#############
if(!$id){
$d['path'] = $setup['path'].'/';
}
else{
$d = mysql_fetch_assoc(mysql_query('SELECT `path` FROM `files` WHERE `id` = '.$id.' LIMIT 1'));
}
if(!is_dir($d['path'])) die('Folder not found.</body></html>');
###############SzSlN?N,NESzS?SlN?S?SzNZ S?SzS2SlS"SzN?SlNZ###############
$all = mysql_fetch_row(mysql_query('SELECT COUNT(`id`) FROM `files` WHERE `infolder` = "'.$d['path'].'"'));
$all = $all[0];
$pages = ceil($all/$onpage);
if(!$pages) $pages = 1;
if($page>$pages or $page<=0) $page=1;
if($start>$all or $start<=0) $start = 0;
if($page) $start = ($page - 1) * $onpage; else $start = 0;
###############SzSlS"N?N?SzSuSL N?SzSlN?SlSa N"SzSaS"SlS2###############
$array_id = array();
$query = mysql_query('SELECT `id` FROM `files` WHERE `infolder` = "'.$d['path'].'" ORDER BY '.$MODE.' LIMIT '.$start.', '.$onpage);
while($list_sw = mysql_fetch_row($query)){
$array_id[] = $list_sw[0];
}
###############S"SlN,SlS2SlSL S.SzS"SlS"SlS2SlSa###################
$ex = explode('/',$d['path']);
foreach($ex as $k=>$v)
{
if($v!='' and $v!='.' and $v!='..' and $v!=$setup['path'])
{
$s = mysql_fetch_array(mysql_query("SELECT `id`,`name` FROM `files` WHERE `path` LIKE '%".clean($v)."/' AND `size` = '0'"));
$s['name'] = str_replace('*','',$s['name']);
if($k >= sizeof($ex)-2) $put .= $s['name'];
else $put .= '<a href="index.php?id='.$s['id'].'">'.$s['name'].'</a>»';
}
}
include 'moduls/header.php';
##############S-SzS"SlS"SlS2SlSa##########################
#
###########################################
/////////Update/////////
if (!$id)
{
include 'added.php';
}
if (!$id){
echo '<div class="t2"><img src="ext/lin.gif" class="ico" alt=""/>Downloads Menu</div>';
}else{
echo '<div class="t2"><img src="ext/lin.gif" class="ico" alt=""/>'.$s['name'].'</div>';
}
###############
###############S?SzSlN?SlSa N"SzS"SlS2 Sl SzSzSzSlSa###############
if ($all == 0) echo '<div class="white">[Empty]</div>';
foreach($array_id as $key => $value)
{
$file_info = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`path`,`fastabout`,`timeupload`,`infolder`,`size`,`loads`,`yes`,`no` FROM `files` WHERE `id` = "'.$value.'";'));
if(is_dir($file_info['path']))
{
if(is_integer($key / 2)) $row = '<div class="main2">'; else $row = '<div class="main2">';
if (!empty($file_info['fastabout'])) $file_info['about'] = str_replace("\n", '<br>',$file_info['about']);
//SsSlS"-S2Sl S?SlS2N<Na N"SzSaS"SlS2 S2 SzSzSzSaSu
$new_all="";
$stime=$time-(3600*24*$setup['day_new']);
//NOT USE//$new_all = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `files` WHERE `timeupload` > "'.$stime.'" AND `infolder` REGEXP "'.$file_info['path'].'*" AND `size` > "0";'));
if($setup['day_new']!=0) $new_all = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `files` WHERE `timeupload` > "'.$stime.'" AND `infolder` LIKE "'.$file_info['path'].'%" AND `size` > "0";'));
if($new_all[0] and $setup['day_new']!=0) $new_all= ' <font color="red"></font>'; else $new_all="";
//S'N?SuS"Sl N"SzSaS"SlS2 S2 SzSzSzSaSu
//NOT USE//$allinfolder = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `files` WHERE `infolder` REGEXP "'.$file_info['path'].'*" AND `size` > "0";'));
$allinfolder = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `files` WHERE `infolder` LIKE "'.$file_info['path'].'%" AND `size` > "0";'));
$name = str_replace('*','',$file_info['name']);
///////////////////////////////Number of new files in the folder
$new_all='';
$stime = $time-(86400*$setup['day_new']);
if($setup['day_new']!=0){
$new_all = mysql_fetch_row(mysql_query('SELECT COUNT(*) FROM `files` WHERE `timeupload` > '.$stime.' AND `infolder` LIKE "'.$file_info['path'].'%" AND `size` > 0;'));
}
if($new_all[0] and $setup['day_new']!=0){
$new_all = ' <font color="#000000">[<font color="#00bb00">+'.$new_all[0].'</font>]</font>';
}
else{
$new_all='';
}
###############CSlS.S'SzS?SlSu S S?S-S"SRS>SzS'
$name32=$file_info['path'];
$name32=str_replace('files/','',$name32);
$name32=str_replace('/',';',$name32);
$name32=str_replace('_',' ',$name32);
if (is_file('razdely/'.$name32.'.txt')) //SuN?S"Sl SlS?Sl S2 N"SzSaS"Su
{
$razd = file_get_contents('razdely/'.$name32.'.txt');
$razdely= '<div class="main2"> '.$razd.'</div>';
echo $razdely;
}
###############SzNESlS2SuNESaSz S?Sz SzS"SzN,S?SlN?N,NS NESzS.S'SuS"Sz
$block=false; //SlS+S?N?S"SuS?SlSu
click_change();
if (is_file('razdely/'.$name32.'.dat')) //SuN?S"Sl SlS?Sl S2 N"SzSaS"Su
{
$block=1;
}
if (is_file('razdely/'.$name32.'1.dat')) //SuN?S"Sl SlS?Sl S2 N"SzSaS"Su
{
$block=2;
}
//S~SaSlS?SaSz Sa SzSzSzSaSu
if(!file_exists($file_info['path'].'folder.png')) $ico = '<img src="ext/dir.png" alt="">'; else $ico = '<img src="ext/dir.png" alt="">'.$file_info['path'].'folder.png" alt=""></div>';
//S?SlS+N?S2SuS?S?Sl S2N<S2SlS'
if (!empty($name) and !$block){
echo $row.'<img src="ext/dir.png" alt=""> <a href="index.php?id='.$file_info[id].'">'.$name.'</a>';
if($new_all) echo '<a href="new.php?id1='.$file_info[id].'">'.$new_all.'</a>';
if(!empty($file_info['fastabout'])) echo '<br>'.str_replace("\n", '<br>',$file_info['fastabout']);
echo '<br></div>';}
elseif ($block==1) { ///SuN?S"Sl NESzS.S'SuS" SzS"SzN,S?N<Sa
$id=$file_info[id];
$sid=$id*2-30;
echo $row.$ico.'<a href="pay.php?sid='.$sid.'">'.$name.'</a> ['.$allinfolder[0].']'.$new_all;
if(!empty($file_info['fastabout'])) echo '<br>'.str_replace("\n", '<br>',$file_info['fastabout']);
echo '</div>';
}
elseif ($block==2) { ///SuN?S"Sl NESzS.S'SuS" SzS"SzN,S?N<Sa
$id=$file_info[id];
$gid=$id*2-30;
echo $row.$ico.'<a href="click.php?gid='.$gid.'&action=1">'.$name.'</a> ['.$allinfolder[0].']'.$new_all;
if(!empty($file_info['fastabout'])) echo '<br>'.str_replace("\n", '<br>',$file_info['fastabout']);
echo '</div>';
}
}
elseif(is_file($file_info['path']))
{
if(is_integer($key / 2)) $row = '<div class="main2">'; else $row = '<div class="main2">'; /////////Ss S"S~S-S?S?StS< Sz S'S"S'SRS"SRStS~S~ SRS?S?S>SzS'
if (!empty($file_info['fastabout'])) $file_info['about'] = str_replace("\n", '<br>',$file_info['about']);
$ex = pathinfo($file_info['path']);
$ext = strtolower($ex['extension']);
//SzNESuS'SlN?SLSlN,NE
click_change();
$pre = '';
if ($prew==0)
{
if ($ext == 'bmp') $pre = 'Impossible Preview <br>';
if ($ext == 'gif' or $ext == 'jpeg' or $ext == 'jpg' or $ext == 'png' or $ext == 'JPG' or $ext == 'GIF' or $ext == 'PNG'or $ext == 'JPEG') $pre = '<img style="margin: 1px;" src="im.php?bab=1&id='.$file_info['id'].'" alt=""/>';
}
//Komments and loads
$all_komments = @mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `komments` WHERE file_id = "'.$file_info['id'].'"'));
$all_komments = $all_komments[0];
$all_loads = $file_info['loads'];
$file_time = date('d.m.y', $file_info['timeupload']);
if ($sort=='name'or $sort=='size') $info = '';
if($sort=='load') $info = '(<font color="#000000">'.$all_loads.'</font>)';
if ($sort=='data') $info = "($file_time)";
if ($sort=='eval' and $setup['eval_change']==1) $info = '(<font color="#000000">'.$file_info['yes'].'</font>/<font color="#000000">'.$file_info[no].'</font>)';
//StSlS2SlS.S?Sz N"SzSaS"Sz
$new_info='';
$filtime2 = $file_info['timeupload']+(3600*24*$setup['day_new']);
if($filtime2>=$time and $setup['day_new']!=0) $new_info = '<img src="ext/new.png" alt=""><br>';
//SsNESzN?SlS2N<Sa NESzS.SLSuNE
if($file_info['size'] < 1024) $file_info['size'] = '('.$file_info['size'].'b)';
if($file_info['size'] < 1048576 and $file_info['size'] >= 1024) $file_info['size'] = '('.round($file_info['size']/1024, 2).'Kb)';
if($file_info['size'] > 1048576) $file_info['size'] = '('.round($file_info['size']/1024/1024, 2).'Mb)';
//S~SaSlS?SaSz Sa N"SzSaS"N?
if(!file_exists('ext/'.$ext.'.png') ) $ico = '<img src="ext/stand.png" alt="">';
elseif ($ext =='jar') $ico = ' <img src="ic.php?lf='.$file_info['path'].'&id='.$file_info[id].'" alt="" width="16" height="16"/>';
else $ico = '<img src="ext/'.$ext.'.png" alt="">';
//SzSlSaSzS. NESzN?SlN^SlNESuS?SlNZ
if($setup['ext']==1) $extension = " [$ext] "; else $extension = '';
//S?SlS+N?N,S2SuS?S?Sl S2N<S2SlS'
echo $row;
$size1=str_replace(')',' | ',$file_info['size']);
echo '<img src="ext/dir.png" alt=""> <a href="view.php?id='.$file_info[id].'">'.$file_info['name'].'</a>'.$extension.$info.'';
if($ext =='txt') { echo '<a href="read.php?id='.$file_info['id'].'&id2='.$id.'"></a><br>';}
echo $new_info.'';
if(!empty($file_info['fastabout'])) echo str_replace("\n", '<br>',$file_info['fastabout']);
$size2=str_replace('(',' | ',$size1);
$info=str_replace('(',' | ',$info);
$info=str_replace(')',' | ',$info);
echo '</div>';
###############SzSlS"N?N?SzSuSL SlS?N"N? Sl N"SzSaS"Su###########
$id2=$file_info[id];
$file_info2 = mysql_fetch_array(mysql_query('SELECT * FROM `files` WHERE `id` = '.$id2));
if (!is_file ($file_info2['path'])) die('SRSzSaS" S?Su N?N?NeSuN?N,S2N?SuN,');
###############S?SaSlS?N^SlN, GIF #############################
#######SzSlS"N?N?SzSuSL SlSLNZ N"SzSaS"Sz Sl SlS+NESzN,S?N<Sa SaSzN,SzS"SlS"#####
$filename = pathinfo($file_info2['path']);
$ext = $filename['extension'];
$dir = $filename['dirname'].'/';
$filename = $filename['basename'];
$back = mysql_fetch_array(mysql_query("SELECT * FROM `files` WHERE `path` = '".clean($dir)."'"));
#
##################
$bolt=0;
if(($ext == 'avi' || $ext == '3gp' || $ext == '3g2' || $ext == 'mov' || $ext == 'mkv' || $ext == 'mp4') && extension_loaded('ffmpeg')){
$pre = '<img style="margin: 1px;" src="ffmpeg.php?id='.$file_info['id'].'" alt=""/><br>';
$bolt=1;
}
elseif($ext == 'thm' || $ext == 'nth'){
$pre = '<img style="margin: 1px;" src="theme.php?id='.$file_info['id'].'&W=90&H=110" alt="prev">';
$bolt=1;
}
if(($ext == 'avi' || $ext == 'flv' || $ext =='swf' || $ext =='mp4') AND (
!$h_ua ||
strpos($h_ua, 'windows') !== false ||
strpos($h_ua, 'linux') !== false ||
strpos($h_ua, 'bsd') !== false ||
strpos($h_ua, 'x11') !== false ||
strpos($h_ua, 'unix') !== false ||
strpos($h_ua, 'macintosh') !== false ||
strpos($h_ua, 'macos') !== false))
{
$pre ='<object type="application/x-shockwave-flash" data="uflvplayer_500x375.swf" height="99" width="125">
<param name="bgcolor" value="#DFE6EF" /><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="movie" value="uflvplayer_500x375.swf" />
<param name="FlashVars" value="way='.$file_info['path'].'&swf=uflvplayer_500x375.swf&w=400&h=300&pic=ffmpeg.php?id='.$file_info['id'].'&autoplay=0&tools=1&skin=white&volume=70&q=&comment=" /></object>
';
}
if($ext == 'ogg' or $ext == 'wav'){
echo '<div class="row1">';
if (
!$h_ua ||
strpos($h_ua, 'windows') !== false ||
strpos($h_ua, 'linux') !== false ||
strpos($h_ua, 'bsd') !== false ||
strpos($h_ua, 'x11') !== false ||
strpos($h_ua, 'unix') !== false ||
strpos($h_ua, 'macintosh') !== false ||
strpos($h_ua, 'macos') !== false)
{
echo'Play Song on (PC)</br><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0 " width="96" height="20" id="own_flashplayer" align="center">
<param name="allowScriptAccess" value="sameDomain" />
<embed src="own_flashplayer_plc.swf?file='.$file_info['path']. '&sta rtplay=false" quality="high" bgcolor="#ffffff" width="96" height="20" name="own_flashplayer" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object></br>'; }
echo '</div>';
}
################# S?SaSlS?N^SlN, GIF #############################
if($pre!=NULL) echo '<div class="row1">'.$pre.'</div>';
if(is_file($setup['spath'].'/'.$filename.'.gif') or is_file($setup['spath'].'/'.$filename.'.GIF')) echo '<div class="row1"><tr><td><img style="margin: 1px;" src="im2.php?pic='.$setup['spath'].'/'.$filename.'.gif&W=100&H=120" alt="screen"></td><td></div>';
###############S?SaSlS?N^SlN, JPG #############################
if(is_file($setup['spath'].'/'.$filename.'.jpg') or is_file($setup['spath'].'/'.$filename.'.JPG')) echo '<div class="row1"><tr><td><img style="margin: 1px;" src="im2.php?pic='.$setup['spath'].'/'.$filename.'.jpg&W=45&H=55" alt="screen"></td><td></div> ';
###############S?SaSlS?N^SlN, PNG #############################
if(is_file($setup['spath'].'/'.$filename.'.png') or is_file($setup['spath'].'/'.$filename.'.PNG')) echo '<div class="row1"><tr><td><img style="margin: 1px;" src="im2.php?pic='.$setup['spath'].'/'.$filename.'.png&W=45&H=55" alt="screen"></td><td></div>';
###############S?SaSlS?N^SlN, JPEG #############################
if(is_file($setup['spath'].'/'.$filename.'.jpeg') or is_file($setup['spath'].'/'.$filename.'.JPEG')) echo '<div class="row1"><tr><td><img style="margin: 1px;" src="im2.php?pic='.$setup['spath'].'/'.$filename.'.jpeg&W=40&H=47" alt="screen"></td><td></div> ';
if (is_file($setup['opath'].'/'.$filename.'.txt')) //SuN?S"Sl SlS?Sl S2 N"SzSaS"Su
{
$f = file_get_contents($setup['opath'].'/'.$filename.'.txt');
$f=substr($f,0,300);
$f = htmlentities($f, ENT_QUOTES, 'UTF-8');
echo '<div class="main2">'.$f.'...</td></tr></div>';
$outp=1;
}
if ($ext == 'txt') {$popis=file_get_contents($file_info2['path']);
$popis=substr($popis,0,100);
$popis = htmlentities($popis, ENT_QUOTES, 'UTF-8');
echo '<div class="main2">'.$popis.'...</div>';
$outp=1;
}
//if ($ext != '3gp' and $ext != 'mp4' and $ext != 'jpg' and $ext != 'gif' and $ext != 'png' and $outp!=1) echo'<div class="main2">Discription is missing</div>';
echo'<div class="main3"><img src="ext/zv3.png" alt=""> Downloads : ['.$file_info['loads'].']</div><br>';
}
}
###############
###############?c?a??a???A??#######
echo '<div class="main2"><img src="ext/dir.png" alt=""/> Page : ';
$asd = $page - 2;
$asd2 = $page + 3;
if($asd<$all && $asd>0 && $page>3) echo '<a href="index.php?id='.$id.'&page=1">1</a> ... ';
for($i=$asd; $i<$asd2; $i++)
{
if($i<$all && $i>0)
{
if ($i > $pages ) break;
if ($page==$i) echo '['.$i.'] ';
else echo '<a href="index.php?id='.$id.'&page='.$i.'">'.$i.'</a> ';
}
}
if($i <= $pages)
{
if($asd2<$all) echo ' ... <a href="index.php?id='.$id.'&page='.$pages.'">'.$pages.'</a>';
}
echo '<br></div>';
###############Manual entry pages ###############
if($pages>$setup['pagehand'] and $setup['pagehand_change'] == 1)
{
echo ' <div class="row"><form action="index.php?id='.$id.'" method="post">Jump to Page :
<input class="enter" name="page" type="text" maxlength="4" size="2" value="'.$page.'">
<input class="buttom" type="submit" value="GO">
</form><br></div>';
}
###############Site Inormation###############
if (!$id)
{
include 'services.php';
}
#############################################
###############Manual entry pages ###############
if (!$id)
{
include 'sitestat.php';
}
if (!$id)
{
include 'adsense.php';
}
###############Manual entry pages ###############
/////////online/////////
if($setup['online'] == 1)echo '<div class="row1"><center><a href="'.$setup['site_url'].'">Home</a> | Online : '.$all_online[0].'</center></div>';
require 'footer.php';
require 'foot.php';
?>
use what shushant said i check if your host alow 3000M ... well, must be allowing . you can also put memory_limit = 3000M . can replace 3000M with your needs.
icedroplet1987 wrote: use what shushant said i check if your host alow 3000M ... well, must be allowing . you can also put memory_limit = 3000M . can replace 3000M with your needs.
can you please tell me where to edit this? in whm right?
look for php.ini file or create one. you can also use it as shushant said in particular file or in configuration file if you have one.
hmm, no need to do it for whole whm cpanel. do it for the one you using for your script.
lovebirds143 wrote: hi i am getting these errors with my sites.. i am using sea script...
""Fatal error: Out of memory (allocated 524288) (tried to allocate 311296 bytes) in /home/xxxx/public_html/domain/Downloads/index.php on line 345"""
How to fix this error?
create php.ini in that folder and put this line
memory_limit = 400M
and save it