Search

How To Increase post_max_size & upload_max_size in cPanel?

  • Thread starter KristinaW
  • Start date
KristinaW

KristinaW

Member
Joined
May 7, 2021
Messages
127
Reaction Score
0
Points
18
  • #1
I have had a few friends try to upload some photos to my new XenForo forum and they tell me that they're getting an error message that says something like the max upload size is too small. Is there a way that I can increase the settings so people can upload larger images to my site? Right now, it seems to be very small. I need it at least 20MB. Can I access these settings through cPanel or do I need to use the command prompt? I'd rather not use the command prompt since I have cPanel at hand.
 
KodyWallice

KodyWallice

Member
Joined
May 7, 2021
Messages
123
Reaction Score
1
Points
23
  • #2
You basically need to edit your php.ini file. PHP comes installed with limitations built into it so errant scripts don't hog so much in the way of resources that they bring the entire server down. If you wanted to try to tackle this via the command prompt, you can take a quick look at these two resources:

https://mediatemple.net/community/products/dv/204404784/how-do-i-increase-the-php-upload-limits
https://mediatemple.net/community/products/dv/204403894/how-can-i-edit-the-php.ini-file

Since you've got cPanel running on your server or hosting account though, follow these instructions:

1. Log into your cPanel account.

2. Once inside, scroll down to the Software section and click the MultiPHP INI Editor link.

multiphp-ini-editor-link-cpanel.gif

3. When you reach the next page, choose your location, or website you'd like to edit, from the drop down box. This drop-down is directly under the Configure PHP INI Basic Settings heading.

4. Once that choice has been made, you'll see a bunch of settings. Both of the ones you want to change should be set to 2MB by default. For most websites, that's way too small (not only for XenForo forums, but WordPress blogs and websites as well). The two settings you're interested in changing are post_max_size and upload_max_filesize.

5. Edit the referenced fields and instead of 2MB, increase the values to 20MB.

cpanel-php-ini-settings-post-max-size.gif

6. When finished, click the Apply button down at the bottom of the page to apply the change in settings. When you now look at the homepage of your XenForo admin panel, you should see that those two values have been changed.

xenforo-server-environment-report.gif
 
CraigHardy

CraigHardy

Member
Joined
May 11, 2021
Messages
223
Reaction Score
2
Points
18
  • #3

How to Increase the File Upload Size in cPanel​

It’s very common to run into issues with a new website where you can’t upload files (photos, videos, etc…) that are more than just a few megabytes. This typically happens with classifieds, forum and blog type websites. Well, any others too, but these are popular. Anyway, the problem is that your settings in your server’s php.ini file are too low. It’s easy to change them in WHM and cPanel though, so if you’re interested, please follow these steps.

– Log into WHM.

– Go to Account Information > List Accounts and click the CP logo for the site you’re interested in adjusting.

– Inside cPanel, find the Software section. Inside of that section, click the MultiPHP INI Editor

– In the drop-down on that page, select the domain name of the website

– Finally, increase the values of “post_max_size” and “upload_max_filesize” and then click the Apply button.

You want to change these two settings to values larger than the files you’ll be uploading. Don’t go too large though because your server may become bogged down if someone gets cute and tries to upload a mammoth file.

I hope this helps.
 
Top