• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

1.1.3 upgrade leaves "out of memory" fatal error - can't access admin

sitwi

Active member
#1
I've nicely tuned my Xenforo site over the last few weeks in preparation for go live, and today upgraded to 1.1.3.

I haven't had a single hitch up until now, but after upgrading (apparently successfully), I'm no longer able to access admin.php.

The Board itself works great, without a hitch, and I can even navigate around the admin area from a window which I'd left open prior to the upgrade. It's just the admin.php which I'm unable to reach.

Here's the error message:

Fatal error: Out of memory (allocated 14155776) (tried to allocate 24692 bytes) in /homepages/blahblahblah/htdocs/xenforo/library/Zend/Db/Statement/Mysqli.php on line 276
Can anyone please help? I was just about ready to go live, as well! :(

I'd really appreciate anyone's time. Thank you.
 

Jake Bunce

XenForo moderator
Staff member
#3
Your memory_limit is very low. HWS is correct... you need to increase the limit. If you are on a shared server or don't have root access then you will need to ask your web host to increase the limit for you.
 

sitwi

Active member
#4
Thanks for such a quick reply, HWS.

This is the level of noob that you're dealing with, though, so I apologise if this is a stupid question - where do I locate this file? If it's not in the root, do I create one?

(The error message seems to suggest a huge amount of activity somewhere, and I've no idea how that would be generated from one simple admin front page - but I should get it working before I start fretting about that!)

Appreciate any further advice.
 

HWS

Well-known member
#5
$ find / -name "php\.ini"
should work if you are not on Windows.

Usually it's in /etc/php.ini

You may ask your server administrator to do this for you.
 

sitwi

Active member
#7
Thanks guys - I'm way out of my depth with this one, I'm afraid. I've been right through and don't see a php.ini file. My understanding is that this file would only affect the folder in which it is placed - if I need to create one, could you please let me know into which folder I should put it?

Do you have any sensible limits that I should include? Could it otherwise be set within the .htaccess?

Sorry for so many questions.
 

Ingenious

Well-known member
#8
I have one in my root folder (the folder above public_html) but have also put php.ini into inividual folders where I want different settings for different applications. I should add I am on shared hosting.

In my php.ini which is a text file and edited using notepad etc. there is this line to set the memory:

memory_limit = 128M ; Maximum amount of memory a script may consume (128MB)

You could even just try a php.ini with just the above in, in your forum directory. This obviously assumes your server set up will read php.ini files in individual folders and apply them, I'm a newbie like yourself with this kind of thing. If you are on a VPS or dedicated then you'd have a master php.ini file as others have said above.
 

sitwi

Active member
#9
Thanks all. I created a php.ini file for the root, containing simply:

Code:
memory_limit = 128M
The error message is now very slightly different:

Fatal error: Out of memory (allocated 16252928) (tried to allocate 3771 bytes) in /homepages/20/d204998416/htdocs/xenforo/library/Zend/Db/Statement/Mysqli.php on line 294
I even increased to 256MB, but no change. Any ideas? Appreciate the help so far.
 

duderuud

Active member
#10
You should make a phpinfo file, that will show you where the php.ini is located on your server.
Create a php file with the following content:
PHP:
<?php
 
phpinfo();
phpinfo(INFO_MODULES);
 
?>
Save and view that file in your web browser.
 

sitwi

Active member
#11
Thank you, duderuud. Just did that, and some further research into 1&1, who are my hosts. Regardless of what I set within my php.ini, they cap the memory_limit at 90mb.

Is there any way to get around this? It seems strange that the board itself is running smoothly, as is the rest of my ACP except for the front page. I just don't understand what's using so much memory!
 

Sadik B

Well-known member
#12
Hi sitwi

Changing the setting in php.ini is the right way of solving this as Jake and others have pointed out. However if you are finding that difficult to do, you can also do this.

Inside your Library Folder there is config.php file. Open the file config.php and add this line right at the top.

ini_set("memory_limit","128M");

Remove the previously created changes in php.ini (which you must have done in the wrong place else it would have worked). By the way if you had made the change in php.ini in the right place, you still need to restart apache for the change to work. If all this seems too technical, don't bother and put the above line in config.php and it should solve your problem.
 

sitwi

Active member
#13
Thank you, Sadik. Same problem after implementing that, though - I do think my hosts are imposing their 90mb limit. I will get onto them about that. It's really strange to me that an upgrade might have suddenly cause the messages, as everything was running smoothly before and it's not a large site (maybe 60,000 posts and 2,000 members).

Thanks again. Puzzled!
 

Sadik B

Well-known member
#14
Thank you, Sadik. Same problem after implementing that, though - I do think my hosts are imposing their 90mb limit. I will get onto them about that. It's really strange to me that an upgrade might have suddenly cause the messages, as everything was running smoothly before and it's not a large site (maybe 60,000 posts and 2,000 members).

Thanks again. Puzzled!
Yes that is possible. Your host can impose a hard memory limit. If they are imposing a 90MB limit, put 90M in config.php and see if that proves sufficient. But yes, xenforo should run fine on about 64M memory limit too for your board... so not sure what is requiring so much memory.
 

sitwi

Active member
#15
No, me neither. Setting the limit to 90mb didn't change it. This is a huge disappointment as Xenforo seemed the perfect solution, but my hosts don't seem able to oblige.
 

robdog

Well-known member
#16
You are definitely not getting to 90MB per PHP cycle. Just look at the error. It appears to die around 16MB. I have never used 1&1 so I have no idea if you have SSH access. Maybe submit a support ticket to 1&1 and tell them to max out this value in the PHP.ini file for you. Because you are definitely not hitting their limit.
 

sitwi

Active member
#17
Thanks all for your generous help. I'm a little further forward with my hosts, who have explained that 90mb is across the whole package. I have maybe ten sites on my package with them, and that could be why 16mb is making it fall over.

I'm going to try shifting my sites around and see if that makes any difference.
 

sitwi

Active member
#19
In terms of security, Sadik? Customer service or tech help? I've had a few run-ins with them in the past (usually over the latter) but they've usually put themselves straight.