Page 1 of 1
Fatal error: Allowed memory size!!!
Posted: Sat Jul 22, 2017 2:30 am
by ehsancapri
I'm using opencart 2.3.0.2 and I know many people have seen this issue before.I've never had this issue until yesterday, when i was adding new product and edit its image.
( I didn't install any extension last 2 month)
Code: Select all
Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 29292 bytes) in /home/aapaa/public_html/system/library/image.php on line 26
But all of the fixes that have been suggested have not worked so far:
• Change memory limit in php.ini ( root and admin folder)
• Change memory limit in my cpanel 128 to 256
• I spoke to my webhost technician and they changed my memory limit 128 to 256
• I added a line in .htaccess
• Removed all image files bigger than 450 kb.((((all my pictures are less than 40kb.
300x300 Pixel - 72 DPI & save for web- RGB and 8bit.))))
• I restart my php server!
and .....
--------
and as I know 128M is enough for opencart so, why I need more than 256?something wrong?
I will really appreciate it if you can help me.
Re: Fatal error: Allowed memory size!!!
Posted: Sat Jul 22, 2017 5:09 am
by artcore
Try to lessen the dimensions and or bitdepth. The size is not only affecting the amount of memory needed to process the image.
Re: Fatal error: Allowed memory size!!!
Posted: Sat Jul 22, 2017 7:04 am
by ehsancapri
I did. all my pictures are less than 40kb.
300x300 Pixel - 72 DPI & save for web- RGB and 8bit.
Re: Fatal error: Allowed memory size!!!
Posted: Mon Jul 24, 2017 7:06 pm
by webcorvo
you have already fix the problem?
Re: Fatal error: Allowed memory size!!!
Posted: Tue Jul 25, 2017 2:47 am
by ehsancapri
webcorvo wrote: ↑Mon Jul 24, 2017 7:06 pm
you have already fix the problem?
Not Yet! Do you have any idea?
Re: Fatal error: Allowed memory size!!!
Posted: Thu Jul 27, 2017 3:30 am
by ehsancapri
Nobody knows a solution?

Re: Fatal error: Allowed memory size!!!
Posted: Fri Jul 28, 2017 1:21 am
by webcorvo
try to install a new OC in a test folder
Re: Fatal error: Allowed memory size!!!
Posted: Mon Jul 31, 2017 1:01 am
by ehsancapri
webcorvo wrote: ↑Fri Jul 28, 2017 1:21 am
try to install a new OC in a test folder
I installed new oc in a folder and it's working good and I don't have any problem!!! So, something wrong with my opencart not my php-memory limit.correct?
any suggestion?
Re: Fatal error: Allowed memory size!!!
Posted: Mon Jul 31, 2017 6:07 am
by IP_CAM
Well, by use of GTMetrix.com, a 20product Category Page Load can easy result in short term
Load Use of 200+MBytes, I would have tried 512MB, then, one never run's into a Memory
Problem. But this depends on the Hosting Agreement, and one should try, to use the max.
allowed Server Memory anyway, if one cares for a speedy Shop, when it comes to multiple
Visitors, browsing at the same time.
But I guess, that the Site ROOT Section may be 'controlled' by
.htaccess settings, thereby
possibly disabling, what OC requires and asks for.
But it's only an idea - STILL, to have a SHOP running in the ROOT - Section means, NOT to have
anything else on that Site, exept for OC-Shops, to make sure. For Pro's, at least.
Good Luck !
Ernie
Re: Fatal error: Allowed memory size!!!
Posted: Wed Mar 11, 2020 10:21 pm
by mbeffa
I moved OC to a new server and got the same message.
I solved it by changing one line in /php.ini to
memory_limit = 1G
Re: Fatal error: Allowed memory size!!!
Posted: Fri Mar 13, 2020 5:52 am
by victorj
Latest cpanel is not using php.ini anymore.
its replaced but a file called .user.ini so if you want to make changes to php edit .user.ini file
Php mem limit is a limit for each php execution, so 256mb is more than enough, unless it need more memory when resizing fotos.
if your page has 20 products, it will use up to 20 times 256mb, so set php mem limit as low as possible to avoid running out of total memory.
note after loading of the page memory is available agian for next page load.
Re: Fatal error: Allowed memory size!!!
Posted: Fri Mar 13, 2020 6:02 pm
by JNeuhoff
A memory_limit of 1G is way too high, something else must be wrong on your Opencart server. What's the URL of your website? Do you have any 3rd party extensions installed on your server?