I'm getting this:
Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 4981690 bytes) in...
That seems a bit odd! From what I can read, it shouldn't happen should it? Isn't meant' to be the other way around. I'm already using a stupidly large memory_limit
You can find the php. ini file in the public_html for your website and right-click on the file to Edit it. Look for the line defining the memory_limit variable and set the value accordingly. Then, save the changes and reload your site to see if the PHP “Allowed Memory Size of Bytes Exhausted” error has been resolved.
The correct way is to edit your php. ini file. Edit memory_limit to your desire value. As from your question, 128M (which is the default limit) has been exceeded, so there is something seriously wrong with your code as it should not take that much.
This usually happens when hosting a high-traffic and big websites using small shared hosting servers, which allocate very little amounts of PHP memory per each hosting plan. To fix the error, you have to manually increase the default PHP memory limit set for your server.
The default memory limit is 256M and this is usually more than sufficient for most needs. If you need to raise this limit, you must create a phprc file.
It doesn't attempt to allocate it all at once. Let's say our limit is 10 bytes. It will allocate 3, 3, 3 and another 3 - boom: throws the error:
Allowed memory size of 10 bytes exhausted (tried to allocate 3 bytes) in..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With