-1

I've encountered an error:

Fatal error: Allowed memory size of 134217728 bytes exhausted 
(tried to allocate 64 bytes)

in /home3/pdmreain/public_html/carpool/admin/lib/Cake/View/HelperCollection.php on line 130 in cakephp, when accessed online, but when accessed through localhost, it works. Why does it work on localhost and how can I make it work online?

Matthew
  • 2,389
  • 2
  • 15
  • 24
  • What do you mean by "online" versus "localhost"? Is that the same system? Or a different system? – arkascha Apr 13 '14 at 12:48
  • What is your `memory_limit` set to in php.ini? Try increasing that and see if it helps. – dethtron5000 Apr 17 '14 at 03:15
  • The exact place the app runs out of memory is not likely to be relevant. Most likely the code is in a loop - check the error log and add that to the question. – AD7six Apr 18 '14 at 22:48

3 Answers3

0

A couple of things to look at:

  1. Some recursiveness is happening in your Helper that is not finishing properly thus creating a memory leak.
  2. The server's memory limit is insanely low. Contact your administrator. https://stackoverflow.com/a/430516/2119863

The error is generated with if (!class_exists($helperClass)) {, try debugging it line-by line. Start by adding pr($helperClass);die right on line 129

Community
  • 1
  • 1
Unamata Sanatarai
  • 5,609
  • 3
  • 22
  • 46
0

This is likely because you have poor code that is going into an infinite loop, or the difference between your PHP setup on your Local vs Production server means you arent giving enough memory for the script - try increasing memory_limit in your php.ini to a higher value to see if this is right and then try optimising your code.

Voycey
  • 781
  • 5
  • 12
0

Change your php.ini file: memory_limit = 256M,

this is a solution but a bad one.

Re-do your code in a simpler way.

Tiago Silva
  • 23
  • 1
  • 6