Do you find yourself struggling with the limited upload size in Moodle? Fear not, with a few simple adjustments, you can increase the max upload size and make your Moodle experience seamless and efficient. Read on for step-by-step instructions.

result after fixed in php.ini

Adjust PHP Settings

Firstly, locate your php.ini file. You can find this by going to Site administration → Server → PHP Info. Edit the file and set upload_max_filesize and post_max_size to your desired limit.These instructions show you how to change the file upload size by editing your php.ini file.

Modifying your php.ini

Open php.ini file and find  “post_max_size“,”upload_max_filesize” and change it to values that suit your needs.

post_max_size=2048M;
upload_max_filesize=2048M;

Adjust .htaccess File

Next, locate the .htaccess file in Moodle’s root directory. Add the following code: php_value upload_max_filesize [desired size]M and php_value post_max_size [desired size]M.

What is .htaccess?

The .htaccess file is a directory-level configuration file used to override server configurations.

How to edit .htaccess?

You can edit .htaccess using FTP or cPanel’s file manager.

Be cautious

Incorrectly editing .htaccess can result in server errors. Always make a backup before making changes.

Adjust Server Configuration File

If Moodle is hosted on a shared server, your hosting company may have configured it to prevent changes to PHP values. You could ask if they can adjust upload_max_filesize and post_max_size in the server configuration file.

Negotiate with your host

Your hosting company may not allow server configuration changes. If so, consider switching to a more flexible host.

Server Configuration File location

If you’re not sure where it is, contact your hosting company or see the hosting provider’s documentation.

Restart Server

Once you have made changes in the server configuration, php.ini or .htaccess file, restart your server, or at least restart the Apache or Nginx service on the server. This makes sure that changes have taken effect.

Test the New Upload Limit

Before rejoicing, make sure to test whether the new limit has been applied. Try uploading a file that is just about the limit and check that it goes through without errors.

Conclusion

Benefits of Increasing Max Upload Size

Users have more freedom to upload larger files without the inconvenience of compression or file splitting.

Upload Limit Tip

Consider making a maximum limit for the course or assignment to avoid overwhelming your server.