Fixed "Fatal error: Allowed memory" without webhos

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Alan Hood
Registered User
Posts: 1
Joined: Sat Sep 20, 2003 1:28 pm

Fixed "Fatal error: Allowed memory" without webhos

Post by Alan Hood » Sat Sep 20, 2003 2:41 pm

I have used PHPBB for a couple of years and benefitted from the great work that the coders of this script. I recently upgraded from PHPBB1.4.2 to 2.0.6 and experienced a problem that appears to be frequently posted at this forum. The purpose of my message is to give back to this community by explaining how I solved the problem; which in doing so may help another user of PHPBB. (Get the quick answer by reading the Summary in Part F below)


The problem I experienced was the following error message

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate [x amount] bytes) in /home/site/url/forum/[file] on line

This error message appeared (1) after I upgraded to PHPBB2.0.6 and (2) when I clicked on a post to view its contents.


I checked this PHPBB forum and found that this error message was frequently reported; however, I did not find a common solution to the problem.

The most common suggested solution was to contact the webhost of the site and increase the memory allocation from ~8Mb to 10 Mb or higher. There was discussion whether this memory problem was due to a memory leak.

I had a hard time believing that my PHPBB forum was greater than 8 Mb of memory, because the forum database at my site was only 1 Mb in size. It didn't make much sense that I needed more than 8Mb for my forum that was 1/8th in size.

I came across another post at the PHPBB forum suggesting to make sure that each smiley has a code next to it.


So, I checked the smilies list and found two to have a strange looking code and the image of the smilie was not a smilie but the same code. So, I deleted these two smilie entries using the PHPBBAdmin. But the problem didn't go away.

However, I noticed that in my smilie list that there appeared to be empty
entries. There were about 30 smilies in the list, but I could see a link at the
bottom of the page indicating to go to the page of smilies. Strange thing was, there were no other smilies images. Because the smilies are listed in a table, I could see the borders to these empty cells.

I wanted to verify that the smilie table had, in fact, empty entries into it.
So, I went to my webhost administrator configuration page (plesk server),
looked at the forum database table using myPHPadmin. I took a look at the contents of the smilie table and verified that there were empty entries. Most of these entries had "Null" in the data columns; however, several had blank entries using this view.

So, I proceeded to delete the 60+ extra smilie entries in this table.

After I completed this, I went back to the PHPBB forum at my site and looked for other strange entries. It was then that I noticed that the number of users was 122; which was impossible because I knew that there were only 35 forum members. Sure enough, I discovered ~90 entries in the user table that were empty. Again, most of these extra entries had "Null" in the table data when viewed from the myPHPadmin utility, whereas some had none. So, I deleted these extra entries in the user table.

It was then that I realized that I should continue to look for more empty
entries in the data tables.

I found extra entries in the "categories" table. However, this time around, I
could not delete them using myPHPadmin because I found that the PHPBB script just recreated these empty forum categories when I viewed the
PHPBBadministration panel. So, I deleted these empty forum categories using the PHPBBadministration panel.

I repeated the process and viewed all the contents of all the tables that
PHPBB2.0.6 created and deleted entries that were blank.


I was pleasantly surprised to find that the "Fatal error: Allowed memory size"
problem disappeared. I recall that it disappeared after I had deleted the extra smilies and extra users. However, I felt that it was prudent of me to "clean up" my PHPBB database tables and get rid of all the extra and unneeded entries.

At no time did I contact my webhost and ask them increase the memory beyond 8Mb. It just wasn't necessary.


This is hard for me to say exactly. I suspect that the cause was due to the
mistakes I made when I upgraded from PHPBB1.4.2 to PHPBB2.0.6. It was not a smooth process and I made a number of mistakes. For instance, I first uploaded the PHPBB2.0.6 forum files incorrectly. I uploaded all the files onto my site in binary (I didn't know it at the time). I then followed the install instructions and used the install.php script to do the upgrade. Naturally, it didn't work. So, I restored the PHPBB1.4.2 forum database files and started over. I then downloaded and uploaded to my site phpBB2.0.0
files correctly. I did the upgrade using the install.php and it appeared to
work. I then uploaded correctly the phpBB2.0.6 files and did the upgrade using the install.php. It didn't work. However, I then came across a post at the PHPBB forum and did the upgrade using the update_to_206.php and it worked, but with the "Fatal error: Allowed memory size" problem (hehe).


The solution to the "Fatal error: Allowed memory size" was to detele any
erroneous/empty entries in the mySQL database tables using either myPHPadmin or the phpBBadministrator panel.

Good luck to all!

Registered User
Posts: 34
Joined: Tue Sep 09, 2003 5:58 pm

Post by g-funk » Mon Oct 13, 2003 10:17 am


I had the same problem as you with the error message poping up all the time.
But i did not have any empty entys in the database.

My fix was to install the newest version of PHP. The one i have from Suse 8.1 has a loot of memory leaks. Once I installed all the appropriate packages such as apache devel ect. and compiled PHP it all works fine.



Return to “2.0.x Support Forum”