EdgarsK Posted August 19, 2009 Report Share Posted August 19, 2009 (edited) Notiek formas submit ar vairakiem foto <?php for($i=0;$i<$photo_count;$i++){ $image=$i.time().$i.".jpg"; $this->upload($_FILES["create"]["tmp_name"]["photo"][$i],BASE."/images/products/$image"); $this->thumb(BASE."/images/products/$image",BASE."/images/products/100-$image",100); $images.=($images ? ";" : "").$image; } ?> klases funkcijas <?php function upload($source,$dest) { copy($source,$dest); chmod($dest,0644); } function thumb($source,$dest,$tosize) { $size = getimagesize($source); $thumb_height = ( int )(($tosize/$size[0])*$size[1]); $thumbnail = ImageCreateTrueColor($tosize,$thumb_height); $src_img = ImageCreateFromJPEG($source); ImageCopyResampled($thumbnail,$src_img,0,0,0,0,$tosize,$thumb_height,$size[0],$size[1]); ImageJPEG($thumbnail, $dest); ImageDestroy($thumbnail); unset($size); unset($thumb_height); unset($thumbnail); unset($src_img); } ?> Kļūdas ziņojums: Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 14016 bytes) in F:\dev\engine\core.php on line 132 Kļūme: $src_image=ImageCreateFromJPEG($source); Atgrāk bija tādi pati problēma, bet tad es pievienoju "unset" kas palīdzēja, bet tagad nepalīdz. Edited August 19, 2009 by EdgarsA Quote Link to comment Share on other sites More sharing options...
EdgarsK Posted August 19, 2009 Author Report Share Posted August 19, 2009 Kā vienmēr problēma atradās un izlabojās [sOLVED] ini_set("memory_limit","50M"); Quote Link to comment Share on other sites More sharing options...
masq Posted September 20, 2009 Report Share Posted September 20, 2009 (edited) Problema, Lai cik lielu 'x' es liktu -> ini_set('memory_limit', 'xM'); Man visu laiku rāda to erroru ,tikai šādi: Pāra skaitļiem: Allowed memory size of 16777216 bytes exhausted (tried to allocate 6144 bytes) Nepāra: Allowed memory size of 15728640 bytes exhausted (tried to allocate 24576 bytes) Kods kur tas notiek: //x Menu $queryMain = "SELECT * FROM items WHERE cateogry='x'"; $resultMain = db_query($queryMain); $test = mysql_fetch_array($resultMain); echo "<li><a href='index.php' onclick='return clickNode('r1n1')'>Iebūvējamie Ledusskapji</a>"; if ($test > 0) { echo "<ul id='r1n1'>"; while($row = db_array($resultMain)) { echo "<li><a href='show.php?id=".$row['id']."'".$row['name']."</a>"; echo "</li>"; } echo "</ul>"; echo "</li>"; } else { echo "</li>"; } //y Menu $queryMain = "SELECT * FROM items WHERE cateogry='y'"; $resultMain = db_query($queryMain); $test = mysql_fetch_array($resultMain); echo "<li><a href='index.php' onclick='return clickNode('r2n1')'>Ledusskapji</a>"; if ($test > 0) { echo "<ul id='r2n1'>"; while($row = db_array($resultMain)) { echo "<li><ahref='show.php?id=".$row['id']."'".$row['name']."</a>"; //SAJA linijā errors echo "</li>"; } echo "</ul>"; echo "</li>"; } else { echo "</li>"; } Esmu mēģinājis arī 200M ;D [sOLVED] Man include("header.php"); bija iekš header.php ;D Edited September 20, 2009 by masq Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.