How to increase the maximum allowed upload filesize for Moodle

user56512 picture user56512 · Aug 28, 2012 · Viewed 13.2k times · Source

I've tried all of the suggestions that I've found and haven't succeeded in eliminating the error message:

The page at [ip address] says:
[filename] is too large to upload

I'm running Ubuntu 12.04.1 server and Moodle 2.3.1+. As others have suggested, I modified /etc/apache2/httpd.conf adding LimitRequestBody 0 so that there is no limit on the maximum size of uploads.

I also modified /etc/php5/apache2/php.ini setting:

post_max_size = 1024M
upload_max_filesize = 1024M
max_execution_time = 300

Those changes actually had an effect on Moodle and caused it to list larger upload limits in the site security policies and the course settings. Prior to revising php.ini the maximums were 2MB. And so, I set each of those limits to 1GB.

http://[ip address]/moodle/admin/settings.php?section=sitepolicies
http://[ip address]/moodle/admin/settings.php?section=coursesettings

And still I get the error message that the file I'm trying to upload is too large. It is only 30MB.

Can you help?

Answer

Vladimir Posvistelik picture Vladimir Posvistelik · Aug 28, 2012
  1. Did you reload your web-server instance?
  2. What about memory_limit directive?
  3. Did you try to search any .htaccess file, that might override your settings?

However, your question is related to the PHP change the maximum upload file size issue


Moodle docs:

To see your actual php settings, you can look at: http://[path to moodle]/admin/phpinfo.php and http://[path to moodle]/admin/environment.php