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

XF 1.1 Fatal error: Out of memory (allocated 9699328)

A

account8226

Guest
#1
Hello; today I had the following error on my forum :

Fatal error: Out of memory (allocated 9699328) (tried to allocate 7680 bytes) in /home/CENSORED/public_html/library/XenForo/Model/Attachment.php on line 26

That's not the first time it has happening.

I was just going to read a thread.

Thanks you very much.
 

infis

Well-known member
#2
In php.ini
;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;
max_execution_time = 60
max_input_time = 60
memory_limit = 512M

Last option.
 

Jake Bunce

XenForo moderator
Staff member
#3
infis is correct. You need to increase the memory_limit on your server. You can ask your host or server person to do this.

You can also try changing the memory_limit yourself. These methods don't always work, but try adding this to your library/config.php file:

Code:
ini_set('memory_limit', -1);
Or add this to a .htaccess file on your server (only works on Apache servers):

Code:
php_value memory_limit -1
 

Mike

XenForo developer
Staff member
#4
Actually a memory_limit won't work here - the memory can't actually be allocated (hence "out of memory"). You'll need to contact your host about this as they're basically limiting you to 9MB of memory (probably including all loaded scripts too) and that's rather unreasonable. PHP today defaults to a 128MB limit.