Maximum file upload size in Moodle

In Moodle 2.X, by default maximum upload file size is 2MB. How do you increase the max upload size for Moodle?

The solution which you see here apply to you if your Moodle is running in a Shared Hosting.  Right now my Moodle site is hosted at and using cPanel.

1. Use your FTP client and connect to your Moodle server and open public_html folder.  In public_html folder you will find a file called  Click on file and press edit button.

Editing PHP.INI fine in Moodle

2.  The file which you open will have one line.  You need to add

upload_max_filesize = 20M
post_max_size = 20M

to your file and save the file to your server.  If you want to increase the file size just change the numbers

Upload Max file Size  in Moodle

3.  Now login to your Moodle site as administrator
Go to Site Administration | Security | Site Policies | Maximum Uploaded file section

This specifies a maximum size that uploaded files can be throughout the whole site. This setting is limited by the PHP settings post_max_size and upload_max_filesize, as well as the Apache setting LimitRequestBody. In turn, maxbytes limits the range of sizes that can be chosen at course level or module level. If ‘Server Limit’ is chosen, the server maximum allowed by the server will be used.

Click on the drop down list and you should see your new maximum uploaded file size in Moodle.  Select your new maximum uploaded file size and click OK


4. Also go to Course Administration | Edit Settings|  if you don’t see the new maximum uploaded file size , just click on the dropdown and apply new size 


Published by Aryan Nava

Founder of "BlockchainMind", CTO for two Blockchain startup during 2018, Cloud/DevOps Consultant and Blockchain Trainer

3 thoughts on “Maximum file upload size in Moodle

  1. hello i have followed these very clear instructions but the max upload filesize is still set to 2MB in site admin > security > policies. i copied your php.ini file exactly.

    do you need to restart the apache server to make this work?

    Moodle 2.0.2+ (Build: 20110406)

  2. hello buddy, i’m using moodle 2.2 and I didn’t find this file “php.ini” in it. Do you know if the file exists in moodle 2.2?

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: