Hi all,
I have problems uploading images over with a file size of 1.2MB. I get the following error:
Fatal error: Allowed memory size of
Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 8192 bytes) in /home/site/public_html/assets/snippets/maxigallery/watermark/Thumbnail.class.php on line 183
I have set the max upload size in the php.ini file to 16MB but still no joy.
Can anyone help?
Thanks
max upload size is not the memory limit, it’s max upload size.
Check these values from php.ini:
max_execution_time, this is the maximum execution time allowed for each script, in seconds (it takes quite some time for maxigallery script to process the images if there are many of them and many imaging "filters" used).
max_input_time, this is the maximum time each script may spend parsing request data, in seconds.
memory_limit, this is the maximum amount of memory in megabytes that a script may consume (maxigallery keeps the images in memory while it makes thumbnails etc).
post_max_size this is the maximum size of POST data in megabytes that PHP will accept (the pictures travel in the post data).
upload_max_filesize this is the maximum allowed size for uploaded files in megabytes.
These settings can also be configured from Apache, so you might want to see if the following can be found from your httpd.conf:
php_admin_value upload_max_filesize Sets the corresponding php setting, see above.
php_admin_value post_max_size Sets the corresponding php setting, see above.
php_admin_value memory_limit Sets the corresponding php setting, see above.
LimitRequestBody Same as post_max_size php setting, but for apache.
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
Needed memory is about 5 times the image size. So in your case it would be 3456x2304x5 = 39,8MB
Try setting a bigger memory_limit value or resize the picture to a smaller size before uploading.
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
Usually the custom php.ini is kept outside the document root (eg. outside public_html folder) in the root of your www domain account. You might want to ask your host for the correct place.
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
I think you misread Doze’s reply (unless I’m misreading it). You should place the php.ini life in you in the www directory or maybe in the manager directory.
-
☆ A M B ☆
- 24,524 Posts
php.ini files do not cascade, nor are they inherited from folder to subfolder. You need to have one in every folder where the directive needs to be used.