You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @ranaanees, this error is displayed when a PHP script uses too much RAM than autorized by php.ini (your PHP configuration) !
Here, your PHP config autorizes 33554432bytes (32Mb) of RAM per script which is a very small limit when using GD library for image manipulations (that uses a lot of RAM when images are big) !
You should increase this limit, either :
By editing your php.ini (if you have a dedicated server and access to the file) and by editing "memory_limit" value :
memory_limit = 128M;
Or if you don't have access to php.ini file (like a shared hosting) or if you don't want to edit your php.ini file, you can add this value in a .htaccess file :
# .htaccess
php_value memory_limit 128M
Or you can directly call a php function "ini_set" in your PHP script before image manipulation to "say" that the script is authorized to use more RAM :
In the examples, I choosed 128Mb of RAM maximum per PHP script.
If you are on a shared hosting, there is a limit of maximum RAM that can be increased (and sometimes you just can't increase it, so you can't use GD or your need to manage smaller images than currently) ! Check your hoster rules.
To use less RAM, a good advice is to resize your image as smaller as possible in your script before manipulating it with cropping, rotating, etc... Because, for example, rotating an image of 4000px per 3000px will consume a lot of RAM compared to an image of 1000px per 750px ^^
Hii,
I am getting following error when uploading images...
Allowed memory size of 33554432 bytes exhausted (tried to allocate 4793473 bytes)
and it shows error on following code..
Help please...
The text was updated successfully, but these errors were encountered: