XF 2.0 Help with increasing Max Attachment size

I'm new to XenForo, and am looking for some help with setting up my attachments. I need to be able to allow attachments up to probably 5MB or so, but when I go to Setup > Options > Attachments > Maximum attachment file size, the maximum that it will allow is 2048KB, as it states
The configuration of this server limits this value to 2,048 KB.

I upgraded my DigitalOcean droplet to 4GB memory, 2 vCPUs, and 80GB of space as my server, but I'm not sure what I need to do in order to be able to increase these limits. Do I need to change something in a .conf file somewhere perhaps?

Thank you in advance
 
I found a solution.

In case anyone else comes across this same issue, all you need to do is edit a couple of lines of code in the php.ini file

Using command line:
nano /etc/php/7.0/apache2/php.ini

Change these lines to something like 12M and 10M or whatever size you want (they're pretty far down in the file)...
upload_max_filesize 12M
...
post_max_size 10M

Then restart Apache:
sudo service apache2 restart
 
Thank you, DS. Could you please dumb it down a little more please? In which environment (software) do I have to use to edit the php.ini file? Where is that command prompt?

EDIT: I got a very quick reply from the hosting provider:

Thank you for contacting us back. I have created a /public_html/yourforum.com/php.ini file and added the following lines:

upload_max_filesize = 16M
post_max_size = 16M
memory_limit = 64M
max_execution_time = 300


So that the upload file size should be increased to 16MB. If it's still not working, please provide us with the forum admin login URL and login information along with the exact steps to reproduce your issue.

However, the Options -- Attachments still shows 2,048 KB max. And I tried and could not upload anything larger.

Could it be that they created/edited a wrong php.ini ?
 
Last edited:
Thank you, DS. Could you please dumb it down a little more please? In which environment (software) do I have to use to edit the php.ini file? Where is that command prompt?

EDIT: I got a very quick reply from the hosting provider:

Thank you for contacting us back. I have created a /public_html/yourforum.com/php.ini file and added the following lines:

upload_max_filesize = 16M
post_max_size = 16M
memory_limit = 64M
max_execution_time = 300


So that the upload file size should be increased to 16MB. If it's still not working, please provide us with the forum admin login URL and login information along with the exact steps to reproduce your issue.

However, the Options -- Attachments still shows 2,048 KB max. And I tried and could not upload anything larger.

Could it be that they created/edited a wrong php.ini ?

Did you upload that file and overwrite your previous php.ini with it? Did you then restart Apache after?
 
I am not the host admin, Lunarpages are. I emailed them one more time asking to reboot the server and make sure they edited the correct php.ini. That did the trick!

They said that rebooting does not make a difference but affects 100 other accounts on the server.

But they must have not edited the right php.ini the first time. Now I see in my admin panel: "The configuration of this server limits this value to 102,400 KB." LOL! I set it to 16 MB to allow forks to uploiad all images from their smartphones without editing.
 
Just moved to another server and had to increase the upload limits once again. This time I asked my hosting company how they did it. Here is their reply:

"The new version of cPanel uses the file ".user.ini" for custom PHP configuration. You can edit values in the file "/home/user/public_html/domain.com/.user.ini" if you need to customize PHP parameters in future."
 
on ispmanager panel
go to web-server settings
click on PHP
enter php settings
find the line with "upload_max_filesize"
click to change, default is 2M means 2MB
change to desireable size (for example: 200M is = 200MB) & save it
go to your XF admin panel > Setup > Options >Attachments
change Maximum attachment file size: as well (example: 200MB is 20000KB
 
Back
Top Bottom