Cannot change course file upload limit

Cannot change course file upload limit

by Esteban Sabadotto -
Number of replies: 11

Hi everyone,

This issue is driving me mad. I'm currenly on Moodle 3.0.9+ (Build: 20170503) - Upgraded from 2.6.

I've successfully changed the php.ini variables to increase the file size limit to 256Mb and this worked perfectly as can be seen here (site administration - security - site policies) :


As you can see, the max file size allowed for a user is also 256mb (in this case it is set in bytes as requested by the interface).


The general setting for courses is also at this same value (site administration - courses - course default settings)


HOWEVER! when I go to any course (even when I try to create a new one) the default value for file upload is 64MB, and I'm not able to set it to the 256Mb limit I've specified...


Does anyone know why this might be happening? am I missing something?!

Thanks!



Esteban

Average of ratings: -
In reply to Esteban Sabadotto

Re: Cannot change course file upload limit

by Esteban Sabadotto -

Sorry, second image should be this one: 

In reply to Esteban Sabadotto

Re: Cannot change course file upload limit

by Ken Task -
Picture of Particularly helpful Moodlers

Looks like you've solved your own problem.   Good!   Could be that your change to php config wasn't present because you forgot to restart the web service.   The second screen shows it works now so the web service must have been restarted.

Courses that existed before the change will still retain their setting if not set to 'site max'.   So in some courses you might have to go back and make that change for those courses.    Any new course should show your new max.

'spirit of sharing', Ken

In reply to Ken Task

Re: Cannot change course file upload limit

by Esteban Sabadotto -

No Ken, sorry if I mislead you but I have not solved the problem. Each course is still showing 64Mb. What I was showing in my previous post was that in the default course setting it shows the value set in the php.ini, but I still cannot get this same value in each of the courses...

BTW, my php.ini has this:

upload_max_filesize = 256M

post_max_size = 256M

max_execution_time = 800


and it looks like this on the server:



In reply to Esteban Sabadotto

Re: Cannot change course file upload limit

by Ken Task -
Picture of Particularly helpful Moodlers

In the past if a course had *site max* set then when the site max was changed in php and apache service restarted, then the course would show *site max* still but with the new MB value.

IF a course had uploads set to something lower than *site max* it would retain that setting.   Had to go into the course settings, and choose *site max* ... at the top of the pick list.

So you are saying all the courses don't have *site max* listed with the new value - 256M?

3.0.9 upgraded from 2.6.x ... how did you do that?  In steps or hyperjump?  That series is also at 3.0.10 now.

What's version of PHP? Apache? and Operating system?

'spirit of sharing', Ken

In reply to Ken Task

Re: Cannot change course file upload limit

by Colin Fraser -
Picture of Documentation writers Picture of Testers

You edited the php.ini file to show an increase, and the php.inf() shows an increase? Wierd. But then, maybe not. There are other possibilities.

Have you looked to see if there is a limit set in a .htaccess file? What about the site server? Using Apache the http.config file may or may not show a limit, if it does, change it, if not, then there is another issue. Same applies to the ini configuration file used in Windows server.  Either one.   

In reply to Colin Fraser

Re: Cannot change course file upload limit

by Esteban Sabadotto -

Unfortunately I don't have access to make any changes to the Apache settings, that's why I went for the php.ini change. It does affect the site limit for both site policies and default course setting, but for whatever reason it does not reflect the setting on the course it self...

There is no limit on the .htaccess file, and if there was I don't see how it would only affect the course and not the rest of the settings (e.g. site policies and default course setting)?

In reply to Ken Task

Re: Cannot change course file upload limit

by Esteban Sabadotto -

Ken, 

Just to clarify, all have the "site upload limit" setting (site policies - course default settings and course). Problem is that the course does not reflect the actual site upload limit set in php.ini (which is 256MB and is what I get in the site policies and course default setting). The problem is the course itself, which shows "site upload limit (64Mb)". You can see this in the screenshots I've uploaded in this thread. 

I've tried creating a new course to see if I would get the "site upload limit" value set in the course defaul setting, but I still get the same "site upload limit (64MB)" value, so it has nothing to do with courses created in a previous moodle version or with a previous upload limit...

Re. versions:

Php: 5.6.30

OS: x86_64-redhat-linux-gnu

Apache: 2.2.24


Re. upgrade: I've used the standard / recommended procedure as stated in this link: https://docs.moodle.org/30/en/Upgrading


Please let me know if you need anything else.

Thanks in advance!




In reply to Esteban Sabadotto

Re: Cannot change course file upload limit

by Ken Task -
Picture of Particularly helpful Moodlers

That's a start ... but one piece of info left out ... relates to you not having access to apache settings nor .htaccess files on your server ....  Colin's suggestion is not in-correct ... there could be other restrictions set else where that are overriding your setting changes to php.ini.

Where and how are you hosted?  Does the hosting provider have any description of limits/restrictions/maxes etc. on packages they offer customers?

Example responses: SiteGround - cheapo $4.95 month shared hosting. :\  Suffice to say that shared hosting has restrictions ... period.

IF it were  true bug in 3.0.x think there would be/have been many postings about the issue ... and there are not that I can see/find.

Have a server with 3.0.highest, PHP 7.0.x and just tested changing from 250M to 300M ... edited php.ini ... restarted service, refreshed the site policies screen that shows site upload max ... value changed.

Notice ... had to restart the apache service for it to pick up on the change to php.ini.

Can you restart the apache service on your server?


'spirit of sharing', Ken

In reply to Ken Task

Re: Cannot change course file upload limit

by Ken Task -
Picture of Particularly helpful Moodlers

and a follow up that might provides clues ...

your screen shot of the phpinfo taken from Moodle link for phpinfo, doesn't show the top/beginning of phpinfo ... up at the top one would see the path to the php.ini file your server is using.

What php.ini file is your apache loading?

On a standalone box or virtually hosted VPS ... not shared ... that's normally /etc/php.ini

Hosting providers might provide you one in /home/customerid/etc/php.ini

which means hosting providers primary ini @ /etc/ takes precedence over customer file ... and might not allow max upload over 64M ... no matter what you try.

'spirit of sharing', Ken


In reply to Esteban Sabadotto

Re: Cannot change course file upload limit

by Esteban Sabadotto -

After going back an forth with the hosting provider over this issue it turns out the limit is set at the hosting level and there's nothing I can change in .htaccess nor php.ini that will do anything with the file upload limit setting. So, although I was getting the correct / modified value, the server would not take those into consideration, hence the problem.

Lesson learned: if, no matter what you do, the change is not reflected in your moodle setting, then there might be an overriding policy that is preventing the change to take effect.

Thanks all for your help!