yeahz Posted October 16, 2009 Report Share Posted October 16, 2009 Kāpēc, kad es uploadoju bildi, kura sver 2,5 MB, man nekas neparādās (it kā būtu izsaukts exit();), un bilde netiek ielādēta. Ja bilde sver 344 KB, tad tiek ielādēta. Bet max size ir atļauts vairāk kā 2,5 MB. Kur varētu būt vaina? define ("MAX_SIZE","5000000"); Quote Link to comment Share on other sites More sharing options...
bubu Posted October 16, 2009 Report Share Posted October 16, 2009 Kas tas par tādu define("MAX_SIZE", ..) defainu? afaik tev ir jāmaina php.ini settingi upload_max_filesize un post_max_size. To var darīt tikai no php.ini vai .htaccess failiem. Quote Link to comment Share on other sites More sharing options...
yeahz Posted October 16, 2009 Author Report Share Posted October 16, 2009 Vienalga nestrādā. Ieliku šo htaccessā: php_value upload_max_filesize 20M php_value post_max_size 20M php_value max_execution_time 200 php_value max_input_time 200 un vēl pārbaudīju iekš phpinfo(), cipari ir tādi kādus es ierakstīju. Quote Link to comment Share on other sites More sharing options...
fest Posted October 16, 2009 Report Share Posted October 16, 2009 Ieslēdz error reportingu un apskaties, ko dod ārā $_FILES['bilde']['error']. Vēl vaina varētu būt tur, ka nav norādīts upload_tmp_dir, taču pie ieslēgta error reportinga to redzētu. Quote Link to comment Share on other sites More sharing options...
yeahz Posted October 16, 2009 Author Report Share Posted October 16, 2009 ir ieslēgts, nekas neparādās, viss pa vecam. Quote Link to comment Share on other sites More sharing options...
briedis Posted October 17, 2009 Report Share Posted October 17, 2009 Iemācies debuggot. print_r($_GET); print_r($_POST); print_r($_FILES); Quote Link to comment Share on other sites More sharing options...
yeahz Posted October 17, 2009 Author Report Share Posted October 17, 2009 ok, pamanīju vienu kļūdu ka neredzēju error reportieri. E_ALL: Fatal error: Allowed memory size of 25165824 bytes exhausted (tried to allocate 13056 bytes) in C:\AppServ\www\gal.php on line 40 print_r($_FILES); Array ( [image] => Array ( [name] => DSC00179.JPG [type] => image/jpeg [tmp_name] => C:\Windows\Temp\php1368.tmp [error] => 0 [size] => 2650918 ) ) Neko nesaprotu, kāpēc tā. Varbūt tāpēc, ka man ir pievienots vēl image resizers? Jo ja izdzēš to resizera daļu, tad iet, arī visi 2,5 MB. Varbūt kods palīdzēs. Quote Link to comment Share on other sites More sharing options...
RaimixLv Posted October 17, 2009 Report Share Posted October 17, 2009 Iekš php.ini apskaties cik tev ir upload_max_filesize man ir uzlikts upload_max_filesize = 800M tas ir maksimāli var uploadot 800 Megus Quote Link to comment Share on other sites More sharing options...
briedis Posted October 17, 2009 Report Share Posted October 17, 2009 Izskatās ka ielādēta bilde tomēr ir, bet manuprāt, skritpam vienkārši nepietika atvēlētās atmiņas. Visdrīzāk dēļ tās samazināšanas. Paprovē izveidot vispirms teiksim thumbnail bildi, tad atbrīvo atmiņu ar imagedestroy() un tad taisi nākamo bildi. Nevis sataisi vispirms visas reizē aizņemot daudz atmiņas un tikai beigās atbrīvo atmiņu. Quote Link to comment Share on other sites More sharing options...
yeahz Posted October 17, 2009 Author Report Share Posted October 17, 2009 Nestrādā, tas pats. Jaunais kods Uzliku arī 800M. Quote Link to comment Share on other sites More sharing options...
briedis Posted October 17, 2009 Report Share Posted October 17, 2009 Kas tur par kļūdas paziņojumu un kurā rindiņā tagad rādās? Quote Link to comment Share on other sites More sharing options...
yeahz Posted October 17, 2009 Author Report Share Posted October 17, 2009 Tas pats, Fatal error: Allowed memory size of 25165824 bytes exhausted (tried to allocate 13056 bytes) in C:\AppServ\www\g.php on line 39 Quote Link to comment Share on other sites More sharing options...
2easy Posted October 17, 2009 Report Share Posted October 17, 2009 izskatās, ka cēlonis ir pārāk mazs memory_limit ko parāda šī komanda? echo ini_get('memory_limit'); pamēģini skripta sākumā šādu kodu (vai ekvivalentu iekš .htaccess vai php.ini) ini_set('memory_limit', '100M'); Quote Link to comment Share on other sites More sharing options...
yeahz Posted October 17, 2009 Author Report Share Posted October 17, 2009 (edited) Ieliku memory_limit iekš htaccess un kaut kas pagāja uz priekšu, paldies. Bet tagad nevaru atrisināt nākošo problēmu. :D Warning: imagecopyresampled(): 3 is not a valid Image resource in C:\AppServ\www\g.php on line 88 Warning: imagecopyresampled(): 3 is not a valid Image resource in C:\AppServ\www\g.php on line 101 Izvilku ārā vērtības pirmajam imagecopyresampled(): $tmp1 = Resource id #6, $src = Resource id #3, $newwidth1 = 500, $newheight1 = 375, $width = 3264, $height = 2448 Lielākā bilde tiek ielādēta un viss ir ok, abas pārējās ķip tiek ielādētas un samazinātas, bet vienkārši melnas. Edited October 17, 2009 by yeahz Quote Link to comment Share on other sites More sharing options...
waplet Posted October 17, 2009 Report Share Posted October 17, 2009 Resource id rādās ja izvada handlu,, varbūt labāk savādāk viņu izvadīt, jeb manāli? 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.