Files bigger than 123M won't upload

Files bigger than 123M won't upload

by Rob Nielson -
Number of replies: 14

Hello! 

I've created a Page inside of a course and I'm trying to attach a video file to it. The video file is 109M and chrome shows the progress % in the lower left corner from 1% all the way up to 100% no problem, but the circle in File Picker just keeps spinning and spinning. 

If I try a 107M video file it uploads with no problem.

I've edited PHP.INI to make upload_max_filesize and post_max_size have a 1G limit. The moodle configuration page confirms - site max is 1G. But I still can't upload it.

This didn't use to be an issue before. With past installations of Moodle I would simply increase the limits in PHP.INI and files would upload just fine.

Any ideas?

I'm using version 3.4.

I look at the error log after I try to upload and I see this (not sure if it's related):


[22-Mar-2018 16:18:47 UTC] PHP Warning:  Module 'imagick' already loaded in Unknown on line 0
[22-Mar-2018 16:18:47 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library '/opt/cpanel/ea-php70/root/usr/lib64/php/modules/memcache.so' - /opt/cpanel/ea-php70/root/usr/lib64/php/modules/memcache.so: cannot open shared object file: No such file or directory in Unknown on line 0
Again, I can upload files smaller than 123M with no problem and PHP.INI has been increased to allow max uploads of 1G.


Thanks tons in advance!

Average of ratings: -
In reply to Rob Nielson

Re: Files bigger than 123M won't upload

by Rob Nielson -

Really hoping someone can help me here as my website is at a complete standstill until I can fix this issue.

I tried putting an .htaccess file in the moodle directory with:


   php_value upload_max_filesize 1G

   php_value post_max_size 1G


Still no luck with that. 

I contacted the host and he bumped up the server side setting in php.ini to 300M. But, when I tried uploading a 178M file, no luck. So I'm thinking it is something other than the php.ini file. 

Help?


Thanks SO much!

In reply to Rob Nielson

Re: Files bigger than 123M won't upload

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

You might try some of these settings that I have used for phpMyAdmin, and big files.  Just a guess.

php settings

max_execution_time = 5000

max_input_time = 5000

post_max_size = 750M

upload_max_filesize = 750M

memory_limit = 1000M


MySQL settings in my.cnf

max_allowed_packets = 200M


In reply to Rick Jerz

Re: Files bigger than 123M won't upload

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Also, a basic mistake as it is always very easy to overlook, what is the upload limit set to in Site Admin > Courses > Course default settings > Maximum upload size?  

Another issue, albeit unlikely, has your host sent you any messages about the amount of disk space you are using?

In reply to Colin Fraser

Re: Files bigger than 123M won't upload

by Rob Nielson -

Thanks Rick and Colin for your input. Here's some more information I've uncovered:

I tried uploading various files of various sizes.  The largest one I was able to upload was 130,509Kb. The smallest one that I was not able to upload was 133,373Kb. So, it looks like somewhere there is a setting limiting me to uploading files no bigger than 130Mb. The question is.... where?


Rick - I have similar settings in my php.ini that you have. So that doesn't seem to be the issue. I checked my settings in mysql and saw that my max allowed packet was set at 16M. I tried editing that to 200M, but I got a system error telling me I needed superuser permission to do that. 

Colin - Yeah, those were some of the first things I checked. And disk space is not an issue either.


So... 130Mb limit somewhere. Ideas?

In reply to Rob Nielson

Re: Files bigger than 123M won't upload

by Usman Asar -
Picture of Plugin developers Picture of Testers
Rob, are you using Windows Server by any chance?
In reply to Usman Asar

Re: Files bigger than 123M won't upload

by Rob Nielson -

Why do you ask? Is there something I can ask my host?

In reply to Rob Nielson

Re: Files bigger than 123M won't upload

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

It appears that some setting is limited to 128MB.  Yep, where.

It appears that you are unable to adjust your mysql settings, so you might not be able to go much further.

Usman might be on to something.  The question that he wants you to ask your host is "Are you using Windows Server?"  

You might also ask them "How do I change mysql settings."

In reply to Rob Nielson

Re: Files bigger than 123M won't upload

by Ken Task -
Picture of Particularly helpful Moodlers

Reason you are asked .. makes a difference in what suggestions are given ... obviously, Linux isn't Windows. ;)

Now some things to check out ...

First ... found your link in your profile ... and used it to see what be going on.

Appears, at present, site is being redirected in a way that will never complete.

Moodle code appears to be in a /moodle/ directory of your main site and is a version 3.4.x ... main site is www.domain.

Look at the config.php file in /moodle/ code directory ... what does the URL line have?

$CFG->wwwroot=

To reach your site, one would have to go to that URL:

**IF** it has http://domain/moodle/

change it to http://www.domain/moodle ... note ... adding www. in front and that there is no trailing slash at the end of the URL ... yes, that makes a difference.

As far as changing upload limits ...

You've said you had hosting provider change that to 300M but you have also attempted to increase that to 1G (way over what you really need).   If you regain access to moodle, login, and look at the PHP info link.   There you will see what php.ini file is being used and settings.

Don't mind saying that I did not find in hosting providers FAQ's/HelpDesk etc. any doc that talked about how to increase the file size upload limit.

This next question is not being nosey ... hosting providers offer different servers/services ... managed or unmanaged etc..   which is your server?

Relates to the abilities you have to configure your own server - as you have discovered with your attempts to change MySQL settings (your account/login to the DB does have the privleges to make  global changes to the DB server, for example.

Also, hosting providers, might offer 'extra protections' for customers sites .... have you opted into any of those?  And, how the web server is setup is also a factor on how large a file to upload.

If running Apache as a mod or as a cgi means one would have to edit/find different config files where one can set upload limits.

'spirit of sharing', Ken


In reply to Ken Task

Re: Files bigger than 123M won't upload

by Rob Nielson -

Ken -

My host made some changes this morning so it was temporarily not working. It's back up now if you would like to try - www.ASLwithRobNielson.com.

The config.php file is set up correctly with the parameters you mentioned.

I check the php info within Moodle and show local value upload max filesize to be set at 1G and master value set at 300M. 

The host is actually a company that my brother in law is a part of. So he is very willing to work with me on settings. I've asked him if it was a Windows server. Awaiting his reply. I also told him about the MySQL settings so we'll await his response about that later as well.

Anything else I can be checking or asking my host?


Thanks!

In reply to Rob Nielson

Re: Files bigger than 123M won't upload

by Ken Task -
Picture of Particularly helpful Moodlers

You can save yourself/your personal contact at provider some time ... am 99% sure you are running Linux.  Not Windows.

Accessing the front page of the moodle, however, begets a 'broken' icon for the security of your site ...

Looks like:

Info about what FireFox reports:

https://support.mozilla.org/en-US/kb/mixed-content-blocking-firefox?redirectlocale=en-US&as=u&redirectslug=how-does-content-isnt-secure-affect-my-safety&utm_source=inproduct

If tech support set your site's PHP to be able to upload 300M then that should suffice for the size of files you are trying to upload.   However, your site might try to provide a lot of video (an ASL site would/should).

There is a setting for Apache called LimitBodySize.   Normally, by default on standalones, that is set to '0' ... meaning no limit.  However, remotely hosted, and depending upon package/service options chosen, could be limited to no more than 130M and no amount of tweaking/changing PHP will work.

Please see:

https://www.cyberciti.biz/faq/apache-limiting-upload-size/

** BUT ** you need to find that info where you host (LiquidWeb) ... not all hosting providers do things the same way.

'spirit of sharing', Ken

In reply to Ken Task

Re: Files bigger than 123M won't upload

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

One other possibility to check if running Linux is, modsecurity. I don't currently have it installed, but I know that when I did use it, it also had a size limit in it's setup.

In reply to AL Rachels

Re: Files bigger than 123M won't upload

by Rob Nielson -

Al - I've asked if the host is running modsecurity. Waiting to hear back.

Ken - Not sure why it would be throwing out a warning about security. There are no modifications to my moodle site - it is all stock. Does it tell you specifically what it is concerned with? 

I've passed on all the information to my host provider. He's made several server-side changes but nothing works. He feels it is a moodle issue as he says other sites are working fine (don't know if he was testing other moodle sites). 

Moodle documentation says that it only looks at php.ini and .htaccess. But I'm running out of options here as he feels the issue is within moodle. 

I created another moodle and tested that - no luck either. (Not that I expected that to work anyways.)

Is there a workaround? Perhaps to simply upload files directly to the server then use them in Moodle rather than uploading them through file picker? 

In reply to Rob Nielson

Re: Files bigger than 123M won't upload

by Rob Nielson -

Ok.... latest update....

I read through the documentation and learned how to create external repositories. So, I created one and uploaded the larger file to that. I didn't get any error messages so I figured it uploaded. I go into moodle and it doesn't show up. Hmmm. I look in the repository subdirectory and it's not there. So I tried a test... I uploaded the file directly to the server through cpanel. It said it uploaded, but it's not on the server. I then uploaded a smaller one and it showed up on the server. So there's definitely something up with the server and it's not a moodle issue. I told my host about it. We'll see what he says. Ugh.

In reply to Rob Nielson

Re: Files bigger than 123M won't upload

by Rob Nielson -

Final update for this...


It's definitely not a moodle issue. Something to do with the server. After the host played around with it for several days they were able to get it working on their end, but it is still not working on my end. I'll be meeting them in person in a month, so I'll sit down with them and go through it.

But for now, I can at least FTP it and put it into the repository directory. Not the best possible solution but at least it works.

I appreciate everyone's help.