Score:0

How to change the upload_max_size for moodle in Ubuntu 22.04.2 LTS?

iq flag

I am trying to change the upload_max_size for my moodle application following the documentation but after restarting the server i receive a message that the limit is only 2MB

php info here

Moodle ubuntu documentation

Score:0
in flag

The documentation on that Moodle site is out of date by a decade or so. In order to change the maximum upload size on an Ubuntu 22.04 system running Apache and PHP 8.1, you will want to do this:

  1. Connect to your server

  2. Edit the php.ini file for your version of PHP:

    sudo {editor of choice} /etc/php/8.1/apache2/php.ini
    

    Note 1: Be sure to replace {editor of choice} with your editor of choice.
    Note 2: If you are not using PHP 8.1, be sure to replace 8.1 with the version your system is using.

  3. Locate the line that reads upload_max_filesize and change the limit to something that makes sense for your installation:

    upload_max_filesize = 64M
    

    Optional:

    If people will regularly be uploading many files at the same time, consider increasing the max_file_uploads value as well.

  4. Given the way Moodle is designed, it may also be useful to increase the maximum size for POST requests:

    post_max_size = 16M
    

    Note: This will depend on how your students are using Moodle. Generally 16~32M is sufficient to handle anything that most plugins will expect.

  5. Increase the memory_limit to also handle some of the less-efficient modules/plugins that are available for Moodle:

    memory_limit = 256M
    

    Note: Generally 256M is sufficient for most Moodle installations. Some may require 384M if there is a remarkable amount of server-side processing going on with each HTTP request.

  6. Save the php.ini file

  7. Restart Apache:

    sudo service apache2 restart
    
  8. Test your Moodle installation

Ander Canales Medina avatar
iq flag
i followed the steps but i dont know why the `upload_max_filesize` doesn't change. in the moodle php info it says that the limit is 2MB
Ander Canales Medina avatar
iq flag
I already have `post_max_size = 16M` and `upload_max_filesize = 64M`
in flag
Are you running PHP 8.1 or a different version? Are you using a standard LAMP stack or XAMPP?
Ander Canales Medina avatar
iq flag
I am using LAMP also, i am using php 7.4 i went to this route to change the .ini `/etc/php/7.4/apache2/php.ini`
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.