Analgiins Posted September 13, 2005 Report Share Posted September 13, 2005 vienam forumam taisu bilzhu uploadoshanas skriptu. probleemas ir ar bildeem, kuraam paplashinaajums ir .jpg Uz servera upload_max_filesize = 2M. Ja meegjinu uploadot 100 KB lielu bildi, tad viss ok, ja 200KB lielu bildi, tad skripts vienkaarshi nomirst, neizdot pat nekaadu kljuudas pazinjojumu. Vieta, kur tas notiek ir: $image = imagecreatefromjpeg($attachment['tmp_name']); Shitas $image (resource) man ir vajadziigs taalaak lai uztaisiitu mazo bildiiti. Kaapeec tas imagecreatefromjpeg neizdot nekaadu kljuudu? Tjipa atminjas par maz, lai PHP uztaisiitu bildi? GD: Version - bundled (2.0.28 compatible) JPG Support - enabled Link to comment Share on other sites More sharing options...
Robis Posted September 13, 2005 Report Share Posted September 13, 2005 vienam forumam taisu bilzhu uploadoshanas skriptu. probleemas ir ar bildeem, kuraam paplashinaajums ir .jpg Uz servera upload_max_filesize = 2M. Ja meegjinu uploadot 100 KB lielu bildi, tad viss ok, ja 200KB lielu bildi, tad skripts vienkaarshi nomirst, neizdot pat nekaadu kljuudas pazinjojumu. Vieta, kur tas notiek ir:$image = imagecreatefromjpeg($attachment['tmp_name']); Shitas $image (resource) man ir vajadziigs taalaak lai uztaisiitu mazo bildiiti. Kaapeec tas imagecreatefromjpeg neizdot nekaadu kljuudu? Tjipa atminjas par maz, lai PHP uztaisiitu bildi? GD: Version - bundled (2.0.28 compatible) JPG Support - enabled 22228[/snapback] Error reporting on? server prodakšen? Link to comment Share on other sites More sharing options...
bubu Posted September 13, 2005 Report Share Posted September 13, 2005 Error reporting on? Nevis error reporting on, bet gan E_ALL, un savukārt display error = on! Link to comment Share on other sites More sharing options...
Delfins Posted September 13, 2005 Report Share Posted September 13, 2005 OS ? PHP Versija ? Vai pre-compiled PHP (ja non-windows)? Link to comment Share on other sites More sharing options...
Analgiins Posted September 14, 2005 Author Report Share Posted September 14, 2005 error_reporting(E_ALL & ~E_NOTICE); @set_time_limit(0); OS Linux PHP Version 4.3.11 njaa.. uzliku ini_set('display_errors', 'on'); (production serveris, taapeec arii off) shis man izmeta Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 7168 bytes) in /bla/bla/bla on line 139 Ko lai ar shito dara, maybe adminam serverii kaut kas jaapamaina? Link to comment Share on other sites More sharing options...
ohmygod Posted September 14, 2005 Report Share Posted September 14, 2005 error_reporting(E_ALL & ~E_NOTICE);@set_time_limit(0); OS Linux PHP Version 4.3.11 njaa.. uzliku ini_set('display_errors', 'on'); (production serveris, taapeec arii off) shis man izmeta Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 7168 bytes) in /bla/bla/bla on line 139 Ko lai ar shito dara, maybe adminam serverii kaut kas jaapamaina? 22254[/snapback] Neskaties uz fizisko izmēru imagecreatefromjpg veidojot attelu pateeree atminjas daudzumu, kas vienaads ar - platums x augstums x dziljums. Piemēram ja bilde ir 1024x768 ar dziljumu 24, tad tiks izmantoti 18874368 bytes. A mok bitos? kaut kā tur bija biti vai baiti.... btw, manuprāt kaut kur tepat foruma kaadreiz tika runāts par to jau... Link to comment Share on other sites More sharing options...
Analgiins Posted September 14, 2005 Author Report Share Posted September 14, 2005 to ohmygod: ja paldies, tagad ir skaidriiba par sho probleemu. Uzliku ini_set('memory_limit', '16M'); un pagaidaam aizgaaja P.S. Noderiigs posts par sho teemu http://php.lv/f/index.php?showtopic=1084 Link to comment Share on other sites More sharing options...
Recommended Posts