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

XF 1.4 Cannot upload avatars or images

#1
I've read through some of the threads on this but I haven't quite figured this one out.

We've had 1.4 running for about 6 months since conversion. We have never had avatar or image upload problems before. Then about a week ago we've run into the situation where every time someone tries it tells people that the "image is too large".

We have checked with the server and we are no where near maxing out with our usage. In fact the CPU shows hardly any use at all. The problem does not seem to be with the server.


So, in admin panel I changed the size of the image that people can upload to a max size, like 100,000. No change.

I have read that maybe I need to change something in the php.ini file and if I knew where to find that I could do that. (Haven't looked for a couple of days-way too busy giving midterms).

So I need to figure out what the problem is and what I can do to avoid the problem in the future (and if this needs to be merged with some other previous thread that's fine with me).
 

Mike

XenForo developer
Staff member
#2
"Image is too large" doesn't appear to be text that appears in XenForo. What is the exact error message being received?
 

Tracy Perry

Well-known member
#3
There are settings in nginx config that will also control some factors of uploads (if you are using nginx). As you found, there are also settings in the php.ini that control upload sizes.

These are your typical php.ini ones you need to edit
Code:
; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize =
Code:
; Maximum size of POST data that PHP will accept.
; Its value may be 0 to disable the limit. It is ignored if POST data reading
; is disabled through enable_post_data_reading.
; http://php.net/post-max-size
post_max_size =
Code:
; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize =
 

Tracy Perry

Well-known member
#5
@Tracy Perry , where do I find the php.ini file? I can't find it.
Depends on whether you are on shared hosting or VPS/Dedi system. If on a VPS/Dedi, just log in and issue an updatedb and then locate php.ini.
or you can always go to your ACP and pull up the php info page. It will tell you where the php.ini that is in use is located.

This is what mine on my older server shows
Screen Shot 2015-06-21 at 5.55.57 PM.png
 

Mike

XenForo developer
Staff member
#9
upload_max_filesize would generally be the main one, but post_max_size is also relevant. You should find the existing lines and you'll likely want to change the values.
 
#10
These are the values I put in:

upload_max_filesize = 100M
post_max_size = 105M
max_execution_time = 500
Man_input_time = 500
memory_limit = 128M
That's based on recommendations from here and from our host.

@ Brogan, none of the files (images) that people have loaded are very large and we've asked people to only use .jpg and not .tiff etc. Most of the images are fake documents from scammers, photos of scammers, or photos used by scammers. antifraudintl.org. As I say, we haven't had any problem with Xf until a couple of weeks ago.
 
#11
I added a line based on another thread I read and my values now are:
upload_max_filesize = 100M
post_max_size = 105M
max_file_uploads = 20
max_execution_time = 500
Man_input_time = 500
memory_limit = 128M
But I wonder if those are good (correct) values or if I really need to upload max file size to 200 or something?
 

Mike

XenForo developer
Staff member
#14
Please submit a ticket with FTP details (and access to a user we can confirm the issue with) and we'll look into it.
 
#15
I can do that Mike but we have a lot of secure areas with criminal investigation sections and we're concerned about who would be looking in there.
 

Mike

XenForo developer
Staff member
#16
Are those sections of your XenForo install? In terms of a test user, ideally we'd just need access to be able to upload an attachment (or avatar). You can protect access to those areas.

FTP would really just be to get more details about the error that isn't exposed in the UI.
 
#17
Yes, all part of the install. I started a ticket Mike, and there's a user ID to login with there. It worked all right for me. I'll see what others think about the ftp thing and see if there's some way to work that out.