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



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.


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

Last option.

Jake Bunce

XenForo moderator
Staff member
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:

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

php_value memory_limit -1


XenForo developer
Staff member
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.