Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 188 Vote(s) - 3.64 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SOLVED: Fatal error: Allowed memory size of 8388608 bytes exhausted on BBHF

#1
I was browsing and noticed this error message on

[To see links please register here]

today, I thought I should share a solution to it to help others currently facing this problem.

Many website owners runs into this error and sometimes it seems as if it's fixed but just to find out that it is not permanently fixed.

If you are getting an error such as:

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 8192 bytes) in /blah/blah


Below find out how to fix this, either temporarily or permanent solution
The reason is that the application/script running at the moment this error occurred does not have enough memory to complete the given task, hence reporting a fatal error message.

Solutions:

There are many quick fixes, but I preferred a permanent solution.

Solution #1.
If you have access to your php.ini file, the simple solution is to location the memory_limit = in your php.ini file and increase the limit.
e.g change :
Code:

Hidden Content
You must

[To see links please register here]

or

[To see links please register here]

to view this content.


Solutioin #2 if you do not have access to system php.ini file (because you have a shared hosting account )
then you may be able to create a php.ini in your home directory and add the following to it:
Code:

Hidden Content
You must

[To see links please register here]

or

[To see links please register here]

to view this content.

NOTE that some coder will inform you to set the memory limit to '-1' which means UNLIMITED.
In general this is a bad practice and should not be used on any production server.

Solution #3.
If your hosting allow you to modify .htaccess in the root folder of your website.
add the following to the top your .htaccess
Code:

Hidden Content
You must

[To see links please register here]

or

[To see links please register here]

to view this content.

( this may not work if you are on a shared hosting, if you get error 500 after saving, just go back and edit the same file .htaccess and remove the comment the line with php_value like this #php_value memory_limit 256M )
Save it.


Permanent solution:
Since the more visitors on a website uses more resources, (memory etc) dynamically. Thus, a quick fix of increasing the memory will not be a good idea for a website that receive constant traffic.

I quickly wrote this piece of code to automate the process.

In my code, I set the memory not to drop than 30% ( 30 percent ), this way every time the system memory drop to 30%, the code will quickly add another 90% (90 percent) to it.


**BEGIN****
PHP Code:

Hidden Content
You must

[To see links please register here]

or

[To see links please register here]

to view this content.

*END***

Save the above file with any filename, in my case it's saved as memory_reset.php

How to use it?
===============
Just include saved file any header or footer file of your php script, this way if you want to disable it by adding a comment notation infront of the include statement.
e.g.

usage:
open your footer.php or the header.php and type the following:

include_once 'memory_reset.php';
Save it. You are good to go.

To disable it:
just add a comment notation infront of the include statement.
// include_once 'memory_reset.php';
Save it. Your setting is gone.

Let me know if this help?
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through