Moodle / PHP | The uploaded file exceeds the upload_max_filesize directive in php.ini

How to increase the value of ‘upload_max_filesize’ variable to upload a file/plugin of larger size.

We were trying to install a new plugin with size of approx 3.5 mb in our moodle site. It was showing an error:“The uploaded file exceeds the upload_max_filesize directive in php.ini”

These steps show how to change the file upload size by editing your php.ini file.

Ubuntu Linux Instructions:

These instructions assume that you have installed the standard Moodle package, PHP 5 and Apache 2 via apt-get and left it all as a default install. If you have compiled yourself I presume that you will know where your php.ini files is. In my case it (php.ini) is located at following location on Ubuntu: /etc/php5/apache2/php.ini

You need to edit the following two settings in your php.ini file:

  • Type “sudo nano /etc/php5/apache2/php.ini”
  • Press Ctrl and W and type “upload_max_filesize”
  • Change the value to the number of Mb you want your site to accept as uploads and press Enter.
  • Press Ctrl and W and type “max_execution_time”
  • Change the value to 600 and press Enter.
  • Press Ctrl and O and then press Enter.
  • Press Ctrl and X
  • Type sudo /etc/init.d/apache2 restart

Now you will be able to upload the files upto the size you have changed the “upload_max_filesize” variable value to.

Webner Solutions is a Software Development company focused on developing CRM apps (Salesforce, Zoho), LMS Apps (Moodle/Totara), Websites and Mobile apps. If you need LMS app development or any other software development assistance please contact us at lms@webners.com

Leave a Reply

Your email address will not be published. Required fields are marked *