zille Posted September 27, 2015 Share Posted September 27, 2015 Hi, From admin panel I changed the maximum size of image upload to 5mb. Now when uploading image I get following error: 26-Sep-2015 20:14:29 US/Central] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 11952 bytes) in /home/…………………………………Uploader.php on line 270 /** * * rotate uploaded image automatically based on exif orientation * * @param string $fileName * * @return $this */ protected function _imageSmartRotate($fileName) { $output = null; if (function_exists('exif_read_data')) { $exif = @exif_read_data($fileName); if (!empty($exif['Orientation'])) { $image = $this->_imageCreateFunction($fileName); switch ($exif['Orientation']) { case 3: $output = imagerotate($image, 180, 255); break; case 6: $output = imagerotate($image, -90, 255); break; case 8: $output = imagerotate($image, 90, 255); break; } if ($output !== null) { touch($fileName); imagepng($output, $fileName); imagedestroy($output); } } } return $this; } /** * * add watermark to the image that has been uploaded * * @param $fileName * @param $watermarkText * * @return $this */ The line 270 error is this one under Case 6 bold. case 6:$output = imagerotate($image, -90, 255);break; Anyone know what is the problem. Quote Link to comment Share on other sites More sharing options...
QuickOldCar Posted September 27, 2015 Share Posted September 27, 2015 Need to raise your memory limit in the working php.ini file or set it top of the script. Not sure how much memory you have available. php.ini memory_limit = 256M top of script ini_set('memory_limit', '256M'); Quote Link to comment Share on other sites More sharing options...
venkatpvc Posted September 27, 2015 Share Posted September 27, 2015 what is your max uploaded limit in your php.ini file if not what you needed try change in php.ini ; Maximum allowed size for uploaded files. upload_max_filesize = 128M Quote Link to comment Share on other sites More sharing options...
Jacques1 Posted September 27, 2015 Share Posted September 27, 2015 if not what you needed try change in php.ini No, this doesn't have anything to do with the maximum upload size, it's a memory problem. If at all, you'd decrease the maximum filesize so that image manipulation takes less memory. Increasing it to 128M would be counter-productive, because then you definitely exceed the memory limit and fill up your hard drive. Quote Link to comment Share on other sites More sharing options...
zille Posted September 27, 2015 Author Share Posted September 27, 2015 My Maximum size allowed is: 1000000KB. What size should I set. Also max uploaded limit in your php.ini file is set 1000MB as I use the same server for my video website and I upload more than 700MB video files and successful without error but that a different website but same server. 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.