Advertisement:

Author Topic: Allowed memory size of 33554432 bytes exhausted (tried to allocate 35 bytes)  (Read 8936 times)

Offline ne.miguelito

  • Jr. Member
  • **
  • Posts: 355
Hello,

In my forum there is a member that when he click to see the personal messages appears this error:

Quote
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 35 bytes) in /home/nemigue/public_html/Sources/Load.php on line 971


but it's strange because the error just appears to him, anyone know's how to resolve this?

Offline Oldiesmann

  • Lead Developer
  • SMF Super Hero
  • *
  • Posts: 24,052
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • http://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
There's a PHP setting that specifies how much memory a script is allowed to use. When this limit is exceeded, you get that error. In this case, the limit is 32MB, and the script tried to use 35 additional bytes.

It's hard to say why that would only be happening for him, but increasing the memory limit for SMF to 33MB should fix the issue.

Add this code to the beginning of index.php right after the opening PHP tag (on its own line of course):

Code: [Select]
ini_set('memory_limit', '33M');

Offline ne.miguelito

  • Jr. Member
  • **
  • Posts: 355
is to change the index.php  of the public_html?

I change and appears the same error, in attachment is my index.php to see if i do the things right...


Offline greyknight17

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 14,890
  • Gender: Male
    • Kevin's Resource Center
Try increasing that number to like 40M to see if it helps.

Does your host allow you to edit your php.ini file? You might want to ask them to see if they can increase the memory_limit for you instead. They should be able to do this for you on their end :)

Offline ne.miguelito

  • Jr. Member
  • **
  • Posts: 355
I already altered up to 50 M, and gives the same error...

I cannot alter php.ini, nor I know where he is...

Offline greyknight17

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 14,890
  • Gender: Male
    • Kevin's Resource Center
Contact your host.