Error Uploading Videos to Moodle

Keywords: Moodle - Microsoft Azure - Technical issue - Other
Description:
When attempting to upload .mp4 videos to our Moodle instance on a VM in Azure (through the UI). We get the following error:

“The file you tried to upload is too large for the server to process.”

Other files with of the similar size upload OK. It seems to be any files over 82MB that fail with the above message.

We changed the disk size from 64GB to 128GB on the Azure machine to see if that would change it, however, it does the same thing.

I’m very new to these VMs and I don’t have Linux skills. Is there something I might have missed with changing the size of the disk? Or is there a limit on the size of the video’s that can be uploaded?

Any help in kind would be greatly appreciated.

Hope someone can help.

Thanks
Stephen

Hi @stephen.clark,

The following section from the Moodle docs shows how the file upload size can be changed:

https://docs.moodle.org/310/en/File_upload_size#Modifying_the_php.ini_file

You can find the php.ini file in /opt/bitnami/php/etc/php.ini.

Can you check if that works? To edit the file you can either access through SSH or use SFTP.

Best regards,
Michiel

Hi Michiel,

Thanks for your reply. I really appreciate the assistance!

I’ve set the “post_max_size” to 300M, “upload_max_filesize” to 300M and max_execution_time to 600 as per the instructions, but it still shows 80MB in the Administration section. I ran the sudo apachectl restart command too.

The new values are still showing in the php file, so it has saved. In the admin portal it mentions “as well as the Apache setting LimitRequestBody.” I’m not sure how to change this as I can’t search for it in the php file. We do use SSL, but I don’t want to start changing things mentioned in the NGINX article in case I break the system completely. Aaargh!

Hi @stephen.clark,

How did you restart the services? For Bitnami you need to execute this command:

sudo /opt/bitnami/ctlscript.sh restart

Regards,
Michiel

Hi Michiel,

I’ve now tried that restart you mentioned, but it’s still showing 80MB in the admin :sweat:

Should the value in the php.ini file read 300M only, not 300Mb?

Thanks again

Hi @stephen.clark,

Yes, it should be only ‘M’.

Regards,
Michiel

Thanks again Michiel. That’s what I have put. I’ll try restarting the VM to see if that helps.

Hmm. Still the same after VM restart.

I’m certain I’ve done everything right. Apart from that thing about NGINX and the Apache LimitRequestBody - I have no idea where to start with that. Really desperate for other users’ help with this :frowning:

Hi @stephen.clark

Beware that there are two occurrences of the upload_max_filesize and post_max_size in the php.ini file, you should change both of them.

For instance, I have changed my own instance to 250M.

$ cat /opt/bitnami/php/etc/php.ini | grep "upload_max_filesize"
upload_max_filesize = 250M
upload_max_filesize = 250M

$ cat /opt/bitnami/php/etc/php.ini | grep "post_max_size"
post_max_size = 250M
post_max_size = 250M

Notice that both declarations contain the same values.

After that, I have restarted all services using:

$ sudo /opt/bitnami/ctlscript.sh restart

And in my Moodle administration panel, I can see the property updated to the latest value :slightly_smiling_face:

Could you please verify that?

Best regards,
Jose Antonio Carmona


Was my answer helpful? Click on :heart:

@jcarmona thank you so much for adding this into the thread! This has worked.

You and @michiel have been really helpful and I’m so grateful for your help.

Thank you :slight_smile:

Maybe spoke to soon. I’m now getting “Error connecting to the server” after the progress bar reaches the end during the file upload :frowning:

We have a Support Tool that will gather relevant information for us to analyze your configuration and logs. Could you please execute it on the machine where the stack is running by following the steps described in the guide below?

Please note that you need to paste the code ID that is shown at the end.

Hi @jcarmona, thanks for staying in touch about this. I have ran the support tool now. The code is c8fc97b7-cf1c-2bfd-9887-7ccedd26a2ee

Many thanks.
Stephen

Hi @stephen.clark,

Thanks for sharing the bnsupport bundle with us. I don’t see any error message in your Apache logs, but I see you are setting a PHP post_max_size and upload_max_filesize values to 100M. Can you try setting a higher value as @jcarmona suggested in a previous post? Remember to restart the services for changes to take effect

$ cat ./php/etc/php.ini | grep "post_max_size\|upload_max_filesize"
post_max_size = 100M
upload_max_filesize = 100M
upload_max_filesize = 100M
post_max_size = 100M

Thanks @gongomgra and everyone else for your input with this.

I really don’t know why it wasn’t working the other day, by now after increasing the size to 800M on each, the uploads are working fine now. I restarted the bitnami services and also the apache service according to the article provided earlier in the thread.

Thanks again for being so helpful with this.

1 Like

Hi @stephen.clark,

I’m glad to hear the issue has been solved.

Regards,
Michiel

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.