1

I'm using opencart. In my admin page when I access CATALOG>PRODUCTS (I have 73 products - Totally I have four pages). When I access my second page it shows this following error

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 4000 bytes) in /home/justborn/public_html/system/library/image.php on line 34

But, I can access first, third and fourth page. I have tried this solution (Allowed memory size of 67108864 bytes exhausted (tried to allocate 4459414 bytes) in writing an xml file) in my .htaccess file

php_value memory_limit 128M

But, it returns 500 Internal error.. How do I solve this Fatal error: Allowed Memory size of 67108864 ?

Community
  • 1
  • 1
Karuppiah RK
  • 3,894
  • 9
  • 40
  • 80

5 Answers5

9

I have found the Solution

In my admin folder I have a php.ini file

I have changed my memory_limit = 64M; to memory_limit = 128M;. Now it works fine.. I didn't get Fatal Error.

Karuppiah RK
  • 3,894
  • 9
  • 40
  • 80
2

Check your images size in filemanager: there might be some big sized images.

I had 2.9MB size of picture which created such trouble to me.

Now, after reducing the size I've solved it.

lrkwz
  • 6,105
  • 3
  • 36
  • 59
SBimochan
  • 474
  • 4
  • 13
0

Memory limit is more than enough. It seems that there is some endless loop in the script that is not letting it to terminate. Look for any for, while, do while loop in the script. If above remedy does not works, please share code so that issue can be examined further.

  • Also check for bad use of arrays. For example, an array in a loop can become very large, if not reset properly. – andrew Jun 12 '14 at 08:02
  • I have found the solution @andrew – Karuppiah RK Jun 12 '14 at 08:05
  • @Beginner changing the memory limit is more of a "patch". A temporary fix/solution. Detecting bad code and fixing it, it's better. Your code may work now that you have a specific number of items/records to show, but what will happen in the future when these records multiply? – andrew Jun 12 '14 at 09:35
  • @andrew : Is there any other solution for this issue? – Karuppiah RK Jun 12 '14 at 09:47
  • @Beginner like anuj.dikshit and me suggested, try to find bad code practises. First, declare properly all your variables. At the end of loops, destroy/nullify everything that is not needed. Its a slow proccess to debug such errors. Perhaps if you post some relevant code we can assist you more. – andrew Jun 12 '14 at 09:49
0

you have to change the php.ini file on line 18 memory_limit = 64M; to 64 x 2 = 124 or 64 x 4 = 256 but wait ask your hosting provider does they support higher limit size if yes then it will work otherwise you are wasting your energy

ADIL BHAT
  • 193
  • 1
  • 1
  • 12
0

This is the same problem I faced, "Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 8192 bytes) in opencart system/library/image.php on line 26"

This error appears when we upload large images (1.5 MB+ size), at the time of editing the images Opencart system/library/image.php tries to load those images and in order to load BIG images it needs more memory.

In order solve this there are two ways. 1. For shared hosting users

1.1 Open File Manager from cPanel or FTP to your website 1.2 Go to "public_html/image/catalog" 1.3 Look for Big Images and Download and delete those images from the server.

  1. VPS - Dedicated - Cloud - Server where we can manage php.ini

2.1 In admin folder open php.ini file 2.2 Try to increase from memory_limit = 64M; to memory_limit = 128M; or more as required.

This should solve the problem.

I would personally advice to upload optimized images and use solution 1 that is deleting Big Images, this is not create any load on the server.

Mahesh
  • 107
  • 2
  • 6