How to increase the file size upload limit in Moodle 2.3.2

How to increase the file size upload limit in Moodle 2.3.2

by Mark Matsune -
Number of replies: 28

I want to increase the current 10M  file size upload limit to about 150M. Is this possible and if so, is there a SIMPLE way to do this.

I have already tried the following in public_html folder in my cPanels (no success). I changed the original php.ini code settings to this.

; http://php.net/post-max-size

post_max_size = 100M

 

; Maximum allowed size for uploaded files.

; http://php.net/upload-max-filesize

upload_max_filesize = 150M

-----------------------------

When I go back to the Site Policies in my Moodle Site Administration, I also reset the

Maximum uploaded file sizemaxbytes to: Server Limit
 
In the course default settings the largest "Maximum uploaded file size" I can set is still only 10M. I tried to upload larger files anyway (15M - 80M), but of course got an ERROR MESSAGE saying I have exceeded the php.ini limit.
 
My ultimate goal is to be able to upload my converted Moodle 2 course mbz.zip files to restore my courses. If that is not possible, I would like to upload the large audio and video resources zip files into new courses.
 
If it is relevant, I am using the Bluehost hosting service.
 
*** I am a NOVICE, so please be gentle with your advice or instructions. Thanks in advance!!!
 
--- Mark in Sapporo
 
Average of ratings: -
In reply to Mark Matsune

Re: How to increase the file size upload limit in Moodle 2.3.2

by al tobing -

Hi Mark,

This doc suggest to restart your webserver (apache or IIS) to reload PHP with the edited changes.

http://docs.moodle.org/23/en/File_upload_size

HTH

Average of ratings: Useful (1)
In reply to al tobing

Re: How to increase the file size upload limit in Moodle 2.3.2

by Mark Matsune -

Hi Al,

Thanks very much for taking the time to help me. I went through the doc you suggested, but I think it must be over my head. I couldn't find the /etc/php5/apache2/ file/location.

Can I ask one more neophyte question? Is the php.ini file the one in my public_html folder (see the attached screenshot)?

Is this the file where I should be editting the code?

I'm also attaching the php_ini file if you can use it to help me.

Thanks in advance again for your patience and advice.

In reply to Mark Matsune

Re: How to increase the file size upload limit in Moodle 2.3.2

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

Mark, sometimes finding the right php.ini that your moodle is using can be challenging because there might be more than one.   I am not an expert on this, but I don't think that the php.ini in public_html is the right one. 

The php.ini that my moodle reads is in /usr/local/lib (CentOS6).  In my old CentOS5, it was in /etc.  You will probably need to be logged in as "root" to edit this file.  Be careful not to make any mistakes, or better yet, make a backup of php.ini before editing it.  I think that you will need to then restart your server for it to see these new settings.

Hope this helps.  Ask more questions.

1) Can you find the php.ini?

2) Do you know how to log in as root?

3) Do you know how to fine upload_max_filesize when editing php.ini?

4) Do you know how to save your changes?

5) Do you know how to reboot your server?

These are some common neophyte questions, so don't be embarrassed at all asking any of these questions.

Average of ratings: Useful (1)
In reply to Rick Jerz

Re: How to increase the file size upload limit in Moodle 2.3.2

by Mark Matsune -

Hi Rick,

Thanks so much for the new ideas and encouragement. I hope you or someone else will help me with my many neophyte responses to the questions you gave me.

1) Can you find the php.ini? The php.ini in the screenshot (see my previous post) is the only one that comes up when I "search" in the cPanels File Manager.

(There is one more copy, but it is in the Moodle folder which holds all the files in my Moodle 1.9.10 installation which I used until now)

2) Do you know how to log in as root? No, I don't know how or where to do this.

3) Do you know how to fine upload_max_filesize when editing php.ini? I made the changes to the php.ini files using the code editor in the File Manager (see that attached screenshot)

4) Do you know how to save your changes? I saved the changes to the php.ini files using the code editor in the File Manager (see that attached screenshot).

5) Do you know how to reboot your server? No, I don't know how or where to do this.

Thanks in advance to you or anyone who has the patience to continue helping me.

Domo Arigatou from Japan

In reply to Mark Matsune

Re: How to increase the file size upload limit in Moodle 2.3.2

by Tony Butler -

Hi Mark,

As you're using a hosting service you'll probably find a hidden file called .htaccess in your moodle root directory - if not, create one and add the following:

php_value upload_max_filesize 150M
php_value post_max_size 150M

I don't know anything about Bluehost, but assuming they allow .htaccess files (which I believe most hosting providers do) then this should override these values in php.ini for your site. Otherwise this will have no effect, but it has to be worth a try.

Hope this helps.

Tony

Average of ratings: Useful (3)
In reply to Tony Butler

Re: How to increase the file size upload limit in Moodle 2.3.2

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

Mark,

Follow Tony's advice first and see what happens.  In your Moodle,

It appears that your hosting company installed moodle for you, or you did it with a one-click install routine, right?

Have you considered asking your hosting company to increase upload_filesize for you?  Lean on your hosting company for help.  It may be that they will tell you that you cannot increase upload_max_filesize, in which case you are stuck (finding another hosting company).

What do you see, in Moodle, when you go to Site Administration|Server|PHP info?  Anything?  If it shows something, use your "find" command in your browser and look for the value of upload_max_filesize.  Do this before applying Tony's suggestion, and after applying it.  Again, you might need to reboot your server.  I am not sure if .htaccess changes take effect immediately.

1) Your cPanel filemanager may not allow you to go up the directory tree to the point where the real php.ini can be found.  You may need to SSH into your server.

2) Ask your hosting company and see what they say.

3) Okay.  If you get the ability of doing SSH, you might need to learn a UNIX editor, such as nano, if it exists on your machine.

4)Okay.

5) Ask your hosting company.  Many hosting companies give you this ability after you log into your account (before going to Filemanager).

 

In reply to Rick Jerz

Re: How to increase the file size upload limit in Moodle 2.3.2

by Mark Matsune -

Hi again Rick,

Thanks for explaining things to me in terms I think I can understand. Yes, I did the one-click install routine using SimpleScripts in the Bluehost cPanels.

I am going to contact my hosting service and see if they can help me sort this out. I really appreciate your advice.

I hope to post a "Success" message sometime soon. Thanks again for all you help.

 

In reply to Rick Jerz

Re: How to increase the file size upload limit in Moodle 2.3.2

by john gamble -

Hi.

I am new to moodle and have downloaded moodle as localhost.

Uploaded 3 courses and after trying my 4th which was larger i was given a royal no, say file size maybe too large.

Having looked in the settings when uploading and adding courses it does say max file size is 8mb?

How can i change the setting in apache PHP 5.3.5 to be able to upload larger file sizes ?

Regards John.

 

In reply to john gamble

Re: How to increase the file size upload limit in Moodle 2.3.2

by Luis de Vasconcelos -

What is the value of the upload_max_filesize directive in your php.ini file? Try increasing it and see if it fixes your problem.

In reply to Luis de Vasconcelos

Re: How to increase the file size upload limit in Moodle 2.3.2

by john gamble -

where do i find the

php.ini file?

I am using localhost and when trying to upload it only allows me 8mb?

In reply to john gamble

Re: How to increase the file size upload limit in Moodle 2.3.2

by Sakshi Goel -

Hi John

It is in xampp > etc > php.ini

In reply to john gamble

Re: How to increase the file size upload limit in Moodle 2.3.2

by Luis de Vasconcelos -

It could be anywhere, depending on your operating system and how you installed PHP.

Run the PHPInfo() command and look at the "Loaded Configuration File" variable. It will show the path to that php.ini file.

In reply to Tony Butler

Re: How to increase the file size upload limit in Moodle 2.3.2

by Mark Matsune -

Thanks Tony for your two postings. I am going to contact my hosting service and see if they can help me sort this out. I really appreciate your advice.

 

In reply to Tony Butler

Re: How to increase the file size upload limit in Moodle 2.3.2

by Alan Pollock -

Hi Tony

Great advice - worked with my moodle site hosted by VentraIP in Melbourne Australia.

No need for a server restart - within a minute of making the change with .htaccess, my video of 14MB was accepted.


In reply to Tony Butler

Re: How to increase the file size upload limit in Moodle 2.3.2

by Ed Rush -
Thanks -- that worked a treat!
In reply to Mark Matsune

Re: How to increase the file size upload limit in Moodle 2.3.2

by Mark Matsune -

SUCCESS!!!

Thank you Al, Rick and Tony!!! Even a novice like me can get lucky and stumble on to a solution. I reread a BlueHost support ticket and discovered that I should have updated my PHP to "PHP 5.3 (Single php.ini)" instead of  "PHP 5.4".

This generated a new php.ini file in my public_html folder and I was able to change the file successfully:

post_max_size = 200M

upload_max_filesize = 200M

Thanks very much again.

 

In reply to Mark Matsune

Re: How to increase the file size upload limit in Moodle 2.3.2

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

Mark, good news!

When situations like this occur (i.e., someone solving their problem) from other users (non-paid) like Al, Tony, and I, I think about the great support that Moodle provides compared to itscompetitors.  I will sometimes hear people being critical of Moodle because it "lacks support."  I find that I get much better support for Moodle than I do for my school's product (Blackboard).

 

Average of ratings: Useful (2)
In reply to Rick Jerz

Re: How to increase the file size upload limit in Moodle 2.3.2

by Bob Neuner -

Can't agree more about the level of Moodle support, Rick!

Average of ratings: Useful (1)
In reply to Rick Jerz

Re: How to increase the file size upload limit in Moodle 2.3.2

by Mark Matsune -

Hi again Rick,

I couldn't agree more. Our university insists on a paid LMS (i.e. Jenzabar --- maybe something else now???) but with NO multilingual support. If we could use Moodle, our university users of all languages could get support FREE.

Many thanks to all the non-paid users who help neophytes like me get into the e-Learning/b-Learning environments.

Cheers,

Mark

In reply to Mark Matsune

Re: How to increase the file size upload limit in Moodle 2.3.2

by Joshua Durey -

I am using hostgator, which apparently has unlimited storage. Does that mean that the upload size is also unlimited?

I plan to use videos for my course delivery, and many are 700MB+. Would it be better on the students' end if I embed the Youtube?

In reply to Mark Matsune

Re: How to increase the file size upload limit in Moodle 2.3.2

by Csaba Gloner -

Hi Mark,

 I have a Moodle installation on a bluehost shared server.

I did the same as you described here, could create and change the php.ini file. However, this doesn`t take effect on my Moodle site, the max file size is still 50 M.

Do I have to do something else, restart something, etc.? I have already purged the cache.

Thanks

Csaba

In reply to Csaba Gloner

Re: How to increase the file size upload limit in Moodle 2.3.2

by Csaba Gloner -

Hi,

OK, I could solve this myself, I have just realised that there are two php 5.4 versions, it's working with the one called "PHP 5.4 (Single php.ini)". After changing to this all changes in the php.ini file take effect immediatelly on the Moodle site.

Thanks

Csaba

In reply to Mark Matsune

إعادة: How to increase the file size upload limit in Moodle 2.3.2

by Yusra Mohammed -

Hi all,

I faced the same problem and I fixed the php.ini

But still the file limit doesn't change .

 I use the XAMPP and I search for the php.ini in its folder.

 

How could I fixed that problem.

 

Thanx in advance

In reply to Mark Matsune

إعادة: How to increase the file size upload limit in Moodle 2.3.2

by Yusra Mohammed -

However, where I could add or modify the .htaccess file??

In reply to Mark Matsune

Re: How to increase the file size upload limit in Moodle 2.3.2

by praveen gubbala -

the file we should edit is php.ini of server. in that file there are two changes should be done.

1. change the "post_max_size" to 100M

2. change the " upload_max_filesize" to 90M

then restart the server.

go to the site administration->security->site policies

check the Maximum uploaded file size, it will show 90MB. (moodle will take the minimum of  post_max_size and upload_max_filesize)


In case you are working on hosting server, .htaccess is the only way

In reply to praveen gubbala

Re: How to increase the file size upload limit in Moodle 2.3.2

by Nagesh Japa -

Hi

Please anyone help me, how can I increase maximum uploading file size to "My private file" in moodle.

Thanks.