1
votes

I'm getting this and I'm not sure why?

[21-Feb-2015 01:10:43 UTC] PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 32 bytes) in /home/vcasts/public_html/ajax.php on line 30

Line 30 is..

$users[] = rtrim( fgets( $fp, 32 ) );

Help anyone?

1
That line isn't the problem by itself, it's just the straw that broke the camel's back. Your script is loading too much data into memory, you need to figure out why. - Barmar
Can I fix it or not? - user3508178
use less or allocate more. there's no third option - user557846

1 Answers

1
votes

The error is telling you "Allowed memory size of 536870912 bytes exhausted" - you ran out of memory. It's not necessarily this line of code that's the problem, but you have one or more memory hogs somewhere in your app using up about 500MB.

This line just happens to be the one that caused you to exceed the limit.

Refer to this reference answer for how to investigate and fix errors like this.