Detailed instructions to increase the maximum allowed size for uploaded files

Detailed instructions to increase the maximum allowed size for uploaded files

Josep M. Fontana -
Колькасьць адказаў: 83
Hi,

In this thread some very helpful Moodlers (Helen Foster, Ray Lawrence, Tim Allen, and Iñaki Arenaza) helped me solve the problems I was experiencing when trying to increase the maximum allowed size for uploaded files in my server. At Helen's request, I've put together a little tutorial that summarizes what went on in that discussion and what I found out myself so that hopefully others won't have to spend as much time as I had to spend trying to figure out how to do things right.

Helen suggested that this should go to the FAQ in MoodleDocs Administration FAQ. Before I put it there, though, I thought I would post first a draft in the same forum where I requested help so that the people that helped me or perhaps others can have a look at it and make sure I got everything straight. Obviously I'm not a native speaker of English, either, so suggestions to improve the text and make it more clear are also very welcome. Once I get your feedback, I can add it to the official FAQ. This way we also help the dedicated people who manage the documentation section save some time.

Josep M.

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

== How do I increase the maximum size allowed for uploaded files? ==

Please, read first the answer to the question 'How do the limits on uploaded files work?' to place these instructions in their appropriate context.

There are basically two methods:

a) Modifying the php.ini file
b) Modifying the .htaccess file

a) Modifying the php.ini file: locate the following strings and change the values

php_value upload_max_filesize 20971520
php_value post_max_size 20971520

Note: 20971520 would be the integer value for 20M of maximum allowed size in case you wanted to set the maximum to that size.


b) Modifying the .htaccess file

The .htaccess file contains instructions that allow you to override the general default settings of your Apache server. Hence, you can, for instance, increase the upload size for your Moodle installation without affecting other applications.

If you do not have one already, you need to create a file called .htaccess in Moodle's main directory that contains definitions for these settings. This only works on Apache servers and only when Overrides have been allowed.

Thus, in order for the instructions in the .htaccess file to take effect, the file httpd.conf in your Apache installation must contain the following lines:

</Directory>

# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.

<Directory "/full path to your moodle directory">

And the following overrides must be enabled:

# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit

AllowOverride Options Indexes

By default "AllowOverride" is set to none, which would mean that the .htaccess file would not be enabled and would thus not work.

Once the appropriate Overrides are enabled, you need to make sure your .htaccess file contains something like the following:

### Fourthly, sometimes Apache limits the size of uploaded files
### (this is a separate limit to the one in PHP, see below).
### The setting here turns off this limitation

LimitRequestBody 0

### These are optional - you may not want to override php.ini
### To enable them, remove the leading hash (#)

php_value upload_max_filesize 20971520
php_value post_max_size 20971520

Note: 20971520 would be the integer value for 20M of maximum allowed size in case you wanted to set the maximum to that size.

Advantages and disadvantates of the two methods:

Changing the appropriate .htaccess file only affects moodle, and not all other PHP applications. Also, if you only modify the .htaccess file, you won't need to restart the Apache server.

Modifying php.ini, on the other hand, has consequences for all PHP applications installed in the server and always requires the Apache server to be restarted.

Thus, the .htaccess solution seems to be the most desirable alternative. Note, however, that if the httpd.conf has to be modified, you will also need to restart Apache for the changes to take effect. To restart Apache and to modify the httpd.conf file, you must have administrator/root privileges, but if the Overrides are already enabled, you can edit the .htaccess file yourself provided that you have write permissions in the relevant directory.

Сярэдняе рэйтынгаў:Useful (5)
У адказ на Josep M. Fontana

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Just H -
Hi Josep

Just stumbled on this post and read through your previous thread . . . looked like you wheren't exactly having much fun there for a while, I know how that feels!

I'm still on a fairly steep learning curve myself but I did have to modify the upload size a few months back and thought the following may be of interest (sorry I didn't see your previous post earlier in time to help out, I had posted a few months back on the same subject).

I found the easiest way was to change the php.ini file using some scripts on this website (owned by a moderator at my hosts forum). It is a collection of very usefull tips and scripts that I have found come in very handy as a newbie.

Modifying the php.ini file:

If your site is on an external host, they may actually modify it from time to time and you will lose your changes. I believe it is better to use this script and set up a cron job to run it now and then (mine runs every 24 hours). Using this script appends any changes you wish to make to the original on the server and will keep it up to date with any changes your host makes and the changes you have made. It also means you don't have to delve into the original script to find the lines to change.

My host runs php as a cgi which means that when using php4, all directories that contained php files have to have a php.ini file in them. To populate all the directories with the amended php.ini file I used this script.

Using php5 (which my host deployed last week) only one php.ini file is required. To tidy up and get rid of all the php.ini files I used this script. Note: before I ran it I renamed the php.ini file in the root directory to ensure it didn't get deleted and then changed the name back after deleting the rest of them.

Modifying the .htaccess file:

This was not possible in my situation, therefore, may also not possible for others depending on their hosts setup. Quote from the forums at my host: "You cannot change the values in the .htaccess file when php is run as a cgi, as it is here (and as it should be for better security)."

Comments to points in your original post:

"php_value upload_max_filesize 20971520"

I must admit the integers threw me there (having read through your other thread I see where it comes from). IMHO I feel it would be best leaving these figures as 20M as it is easier to figure out e.g. I have set my limits to 100 Mb, off the top of my head I have no idea what that would be as an integer blush


"Modifying php.ini, on the other hand, has consequences for all PHP applications installed in the server and always requires the Apache server to be restarted."

As I understand it, if using php4 I could have numerous configurations in seperate php.ini files e.g. in Moodle I could set it up for 20 Mb uploads, in Drupal 100 Mb and Gallery2 60 Mb etc.

Using php5, as my host has it setup anyway, does appear to affect all scripts I have installed (then again, this may be due to the fact I don't have them in seperate domains at the moment?).

I have never had to restart Apache for changes I have made to php.ini, which is just as well as I wouldn't know how to!

"Thus, the .htaccess solution seems to be the most desirable alternative."

As mentioned above, may not always be possible. When I first installed Moodle last August, the .htaccess file in Moodle actually resulted in lot's of errors beng thrown (guessing this was specific to the way my host has the servers set up) which had to be resolved by my host (unfortunately can't remember the details other than some sort of incompatability). Worth remembering if you are having difficulties in the initial install of Moodle and trying to trouble shoot.

Hope this is of some use and if someone with more knowledge than me (which wouldn't be hard!) notices anything glaringly wrong please highlight my errors.

regards
Harry





У адказ на Just H

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Iñaki Arenaza -
Выява Core developers Выява Documentation writers Выява Particularly helpful Moodlers Выява Peer reviewers Выява Plugin developers
I have never had to restart Apache for changes I have made to php.ini, which is just as well as I wouldn't know how to!

This is normal in your setup. If you run PHP as a cgi, the PHP interpreter is started and reads the php.ini file for every page you request, and then it's stopped. (which is a big performance hit, by the way).

On the other hand, if you have PHP as an Apache module, the PHP interpreter is only startd when Apache starts, and then remains loaded and running inside Apache no matter how many pages you request, until you stop Apache. This is why you need to restart Apache to let the PHP interpreter read the php.ini file (it only reads it when it starts).

Saludos. Iñaki.
У адказ на Iñaki Arenaza

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Just H -
Hi there and thanks for the explanation.

Have just asked my host if they are planning to run php as an Apache module after I read your explanation and sadly they have no intention of doing so журбота

From another thread on my hosts forums I get the feeling they believe it to be more secure running as a cgi?

At the moment it doesn't seem to be having much of an impact the way it is but I'll file your comments away in the back of my mind in case things seem to start slowing down as our enrolments grow.

Thanks again for the info усьмешка
У адказ на Josep M. Fontana

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Iñaki Arenaza -
Выява Core developers Выява Documentation writers Выява Particularly helpful Moodlers Выява Peer reviewers Выява Plugin developers

a) Modifying the php.ini file: locate the following strings and change the values


php_value upload_max_filesize 20971520
php_value post_max_size 20971520

Ups! This syntax is not valid for the php.ini file (it's the right syntax for .htaccess files, though). There you have to use:

upload_max_filesize = 20971520
post_max_size =
20971520

Saludos. Iñaki.
У адказ на Iñaki Arenaza

Re: localhost: Detailed instructions to increase the maximum allowed size for uploaded files

Chris Collman -
Выява Documentation writers
Thanks all. In my localhost  1.6 Beta 4 Moodle sandbox, I followed instructions in this thread and changed my uploaded file size from 16M to 100M.  Here were my successful steps.

I found my php.ini in Apahce/bin and opened it in notebook.  I did a search and changed the values to
Upload_max_filesize = 100M
post_max_size = 100M

Saved the file.  Restarted Xampp (Apache and MySQL) in my Moodle16 directory.  In my browser, went straight to Moodle Configuration>variables and found Permisssion and maxbytes and saw that file size had changed to 100 MB.   I saved the Admin Settings.  I went to my course settings, it showed 100 MB but I saved them again anyway.  Went to files in my course, when I went to upload it now showed me that I could upload a 100 M.

FYI: Key for me was finding the php file in Apache/Bin. I did take a little detour after checking my Configuration settings, I went straight to my course to upload.  It showed the old 16M max upload size.  I went back to the course settings which showed 100M and saved them.  When I went back to upload, it now showed me 100 M.   Don't know if this was just a display issue or if my limit was still 16M. 

Thanks all.




У адказ на Chris Collman

Re: localhost: Detailed instructions to increase the maximum allowed size for uploaded files

Iñaki Arenaza -
Выява Core developers Выява Documentation writers Выява Particularly helpful Moodlers Выява Peer reviewers Выява Plugin developers
I went straight to my course to upload.  It showed the old 16M max upload size.

This is normal. Max upload size is a per-course setting, so it retains the configured value even if you raise PHP max upload size.

Saludos. Iñaki.
У адказ на Iñaki Arenaza

Re: localhost: Detailed instructions to increase the maximum allowed size for uploaded files

Chardelle Busch -
Выява Core developers
I need to make an update here. I mentioned above that just putting the php.ini file in my directory folder had not effected any change, so I ran the script to copy it to all directories. I realized later that the php.ini file was EVERYWHERE. It appeared in my course files and, weirdly, it also became attached to every forum post that already had an attachment--yikes! I ran a script to delete that file--whew.

However, I did realize that after I ran the copy script, the default for the php.ini file in PHP Info now showed as being in my moodle/admin folder--which I probably would have never figured out had I not run the copy script. So, after deleting all the files, I found that by putting the php.ini file in my moodle/admin folder did the trick. So, here's the delete script in case anyone needs to go this route to figure out where the php.ini file should go.
У адказ на Josep M. Fontana

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Mauricio Riveros Barbosa -
I'm using a w2k Moodle setup but I couldn't set up the large size settings:

I found two php.ini files:
  1. c:\easyphp\apache
  2. c:\easyphp\php
I changed both files but there are no results - I can't upload files larger than 2 Mb!
У адказ на Mauricio Riveros Barbosa

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Serge LAOT -
Have you check the php.ini file in Windows directory ?

Well, I have a problem with the max upload file size setting.
I have installed Moodle on :
    - Win Server 2003 + IIS
    - Suse 10.1 + Apache

and applied modifications on php.ini (c:\windows, and /etc/php.ini), .htaccess (Suse) to be able to upload files up to 20M. Even though, it is confirmed by phpinfo(), in Moodle Administration/Configuration/Variables/Permissions, the maximum 'maxbytes' value is limited to 8M instead of 20M.

Why ?

What do I miss ?

У адказ на Serge LAOT

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Serge LAOT -

I simply missed to change the value of "post_max_size" in php.ini.

(and also just forgot to read carefully the first post.


У адказ на Serge LAOT

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Andy Pellow -

Do you need to make changes to php.ini and .htaccess or is it a case of either /or.

I tried making a change to just php.ini and it didn't seem to make any difference, but when I modified .htaccess as well the option (250M) was available when I went to Admin/Variables for my site.

My next problem is that when I try to upload a bigger file I am still seeing the old limit on the upload page and I am getting an error message say the file exceeds the limit for the form.

Any help greatly appreciated.

Andy 

У адказ на Andy Pellow

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Just H -
Hi Andy

Not sure but I think it depends on your server setup e.g. for me it was just a case of modifying the php.ini file.

Re seeing old limit, if you haven't already, update whatever it is where you're trying to upload to (e.g. if it's in a forum or a course then the upload limit would be based on what it was when the forum or course was initially set up).

Regards
H
У адказ на Just H

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Andy Pellow -

Hi Harry,

What I'm trying to do is upload a piece of SCORM content as an activity in a course.

I worked out I was seeing 16M because that was still set in the course details but there is no option to increase it to 250M even though that is available in the site variables.

This is beginning to confuse the hell out of me so any help is much appreciated.

Thanks

Andy

У адказ на Andy Pellow

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Chris Lamb -

As far as I understand it, changing php.ini should do it, as that's the over-riding limit.  If you don't have access to php.ini (eg you're using paid hosting) then .htaccess MIGHT do it because it over-rides the php.ini setting for that folder.  I say 'might' because the server administrator can turn off the .htaccess facility, so you can't over-ride the php.ini setting.  If you don't have access to php.ini and they've turned off .htaccess then there's nothing you can do to increase your upload limit, other than contact them and ask them to do it for you.

In your case you have access to php.ini and .htaccess is turned on, so either should work.  When you changed php.ini did you re-start your web service (Apache/IIS/whatever)?  Changes to php.ini only take effect when your web service starts, but the web service checks .htaccess every time it goes to the folder which the .htaccess file is in, which could explain why your changes to php.ini didn't work but you were able to do it with .htaccess.

HTH

Chris

У адказ на Chris Lamb

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Andy Pellow -

Hi Chris,

Thanks for your help - I realised the reason I wasn't seeing the changes in my course was because I wasn't saving them (D'oh).

Anyway, my problem now is that I can happily upload my SCORM zip files but when I try to save some of them as an activity I get a "Validation result:" pop up and they don't work.

This is only with rerasonably large zip files - smaller ones work fine.  I saw a post which suggested it was the max_execution_time variable in the php.ini file which I have changed to no effect.

Any help, as always, greatly appreciated.

Andy 

У адказ на Andy Pellow

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Andy Pellow -

Hi,

I finally got everything working so thought I would put my thoughts down here (hopefully it is the right place).

My scenario was I was trying to upload a SCORM zip file which was 166Mb in size.

My first problem was increasing the size allowed for uploaded files.  Reading this and various other forum I tried changing my php.ini file (to no effect) and creating a .htaccess file (which seemed to work).

Using the .htaccess file allowed me to upload the zip file but when I tried to save it as an activity in a course I got a "Validation Result" pop up and it didn't work.

I found a solution to this which said change the max_execution_time variable in your php.ini file.  I tried this but again changing my php.ini file had no effect.

I did some digging around and discovered I was changing the wrong php.ini file.

I was changing the php.ini file in my php folder when I should have been changing the php.ini file in my Apache/bin folder.  Once I made the changes there, and restarted Apache, I was able to upload large SCORM files and add them to courses with no need for a .htaccess file.

Hope this is of help to anyone trying the same thing.

Regards

Andy

У адказ на Andy Pellow

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Chardelle Busch -
Выява Core developers
Where do you find the php.ini file?
У адказ на Chardelle Busch

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Chris Lamb -

You'll only have access to the php.ini file if you have access to your webserver, because it's not part of Moodle, so if you're using a paid hosting service you won't be able to change it.

If you do have access to your webserver, it will be either in the PHP folder, or in the Apache folder (if you're using Apache).  I don't know where it is if you're using IIS.  The easiest way to find it if your server is using Windows is to use Windows Explorer's Search facility.

Remember if you change any values in php.ini to restart your web service, as it only checks php.ini when it starts up.

HTH

Chris

У адказ на Chris Lamb

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Just H -
Hi Chris

"... so if you're using a paid hosting service you won't be able to change it."

As far as I'm aware, not quite accurate, as mentioned in my post above, you can use this script to modify the php.ini file.

I use that script to ensure I append things I want to change to the hosts script to ensure I always have the changes I need and any changes the host makes (a cron job calls it once a day).

"Remember if you change any values in php.ini to restart your web service, as it only checks php.ini when it starts up."

As mentioned in my post above, this is not always the case, my host runs php as a cgi "for better security" therefore, I don't have to restart Apache.

So many variables it get's confusing журбота

Regards
H

PS Chardelle, have a look at PHP info from the Moodle admin page for the path to php.ini.
У адказ на Just H

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Chardelle Busch -
Выява Core developers
Hi Harry,

I'm so glad you posted here. Upon your recommendation I've switched to Site5. So far so good with 1.6, except for max upload size of 2M. I asked support and this is what they replied:
"You can create a file in the dir with your php scripts name this file php.ini and add the max file size you want."

Not very detailed instructions. I've created a txt file named php.ini, and added:
<?php

upload_max_filesize 10971520
post_max_size = 10971520
?>

I uploaded it to both public_html and my moodle folder (still not exactly sure where it should go), but still get 2M in my variables (PHP info lists post max as 8M and upload max as 2M--it lists the path as: /usr/local/Zend/etc/php.ini--but I'm not sure how to get there in netadmin). I looked at the link you posted above--but not sure about it. Could you maybe send me the file you use and tell me where to put it?

Thanks

У адказ на Chardelle Busch

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Just H -
Hi Chardelle

Another one jumping on the Site5 bandwagon . . . maybe I should get comission! big grin

Welcome aboard, I hope it works well for you, as mentioned in previous posts I have been more than happy with them and hope they continue with the excellent service I have had thus far . . . although a bit dissapointed with the reply you got from customer service (I think the average customer at Site5 is very cluey on these things unlike myself and perhaps the response can at times be a little vague).

Anyway, you hit the same little bump I did when I first started усьмешка I too initially called the script I run "php.ini" but that's not really the case as the script I use actually grabs the server php.ini file, makes the changes you want and appends it to a new php.in file thereby ensuring you have your changes and any host settings. that said, no idea why yours didn't work?

The attached file will ensure registar_globals is off, increase your upload limit to 150MB and increase PHP memory limit to 24MB (you can add anything else you want by copying one of the $contents lines and modifying to whatever it is you want to do or change the upload limits).

To get it to work:
  • Change YOURSITE in line 5 to your site without the dot (i.e. if your site was chardelle.com it would be chardellecom) to have the modified file put in public_html or you can put the path here to wherever you want it
  • Upload to wherever you want to in your site (I have it in root)
  • Call it in your browser to do the initial run
  • Set up a cron job to run it at a frequency you think is right to ensure it picks up any changes Site5 might make (have mine set for once a day which is probably overkill, doubt if it hardly ever gets changed anyway)
  • Have a look in public_html and you should now have a modified php.ini file
  • Have a look at upload limits in Moodle admin/config and voila . . . or should be!
This is based on running PHP 5.

If you are still running PHP 4 you need to copy the modified php.ini file to every directory that has a php file in it. Use this script to automate that. Basically call it what you want, upload next to the attached file, call it to copy after you have a modified php.ini file.

Hope it works out усьмешка

H

PS Feel free to ask Site5 when they are going to upgrade MySQL and start offering dedicated serves, more people that ask faster it will happen wink
У адказ на Just H

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Chardelle Busch -
Выява Core developers
Okey dokey,

With some trial and error, and help from Harry, I finally got my upload size changed. All of these steps might not be necessary, but it worked for me. For anyone else who is IT challenged, here's how I did it:

This is on a hosted site where I have an account with cpanel type access to my files (file manager) and the ability to upload files to my public html folder (ftp).

1. Download the php_ini_override.php file posted above by Harry. Go to Admin in your moodle site and click on PHP info and look for: Configuration File (php.ini) Path, and copy this for $defaultPath =
For $customPath = change YOURSITE to the name of your user directory on your server (in my case, it is the user name that was created for my account and is a truncated version of my domain). Hint: when you go to File Manager and hover over one of your files in your public html folder you will see the URL for the file at the bottom of your browser and it will includes this path E.g.: https://blah blah.../home/youruserfolder/public_html..blah blah....

2. I then uploaded this file to my public html folder and ran the script. Hint: an easy way to do this is to click on the file name in cpanel file manager, then under the File Operations panel on the right, click on the URL link--you should get a new window that opens with the created php.ini file, and upon refresh you should now see the php.ini file in your putlic html folder.

3. I still had no change to my upload size options. So, I created a copy php ini file (attached) as per Harry's suggestion, uploaded it to the public html folder and ran it as above. Then, the changes were made.


У адказ на Chardelle Busch

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Just H -
Hi Chardelle

Glad to see you have fixed it. From your point 3 above, figure you are still running PHP 4 (therefore, needing a php.ini file in all directories with a php file in it).

PHP 5 is available on Site5 although PHP 4 is still primary. If you want to change to PHP 5 just add: "AddHandler application/x-httpd-php5 .php" to your .htaccess file (without the quote marks). This will then use PHP 5 to parse all php files in that directorie and all sub directories (i.e. no need to have hundreds of php.ini files all over the place!).

I've been running PHP 5 since they upgraded and have had no problems thus far. If you do decide to go PHP 5, run this script to get rid of the multitude of php.ini files you just created!

Regards
H
У адказ на Chardelle Busch

how to modify max file size with WebHost Manager/cPanel 10

Clay Burell -
I just discovered this. No need to hunt php.ini or .htaccess if using cPanel 10 with WebHost Manager.

Just go to "PHP Configuration Editor," and scroll down until you see the max file size entry. Input whatever size you want in MB.
У адказ на Just H

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Ronald Wagner -
Harry, the information you provided worked to a tee.  I am a Site5 fan as well.  Can you please provide the specific line of information that I need to include for the CRON job? 

Should it be:

GET://www.mydomain.com/php_ini_override.php
У адказ на Ronald Wagner

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Just H -
Hi Ronald

My apologies for not seeing this earlier and I have no doubt you have sorted the cron out by now but in case anyone else has the same question here is my cron command:

php -q $HOME/php_ini_override.php >>$HOME/cron.log2>>$HOME/cron.err
У адказ на Josep M. Fontana

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Charlie Wilson -
sorry to ask a stupid question but where are the php.ini and .htaccess files located in fedora core 5 i can't find them for my life!
У адказ на Charlie Wilson

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Geoffrey Rowland -
Выява Plugin developers
In Fedora core 5, the configuration files for PHP (php.ini), the Apache Web server (httpd.conf), and most other Linux programmes, are usually located in the /etc directory, or subdirectories within /etc. Specifically:

  /etc/php.ini

  /etc/httpd/conf/httpd.conf

If, instead of Fedora's native packages, you are using a 3rd-party Web server bundle, they may be located elsewhere (but still usually in an /etc directory). E.g. for the XAMPP Linux bundle, php.ini and httpd.conf are typically located in /opt/lampp/etc/.

Alternatively, as detailed in links earlier in this thread, an additional .htaccess file can be used to 'override' the settings in php.ini and httpd.conf. This is placed in the appropriate Web folder. The default 'top-level' folder for Web pages in Fedora 5 is /var/www/html/, so a likely location for the .htaccess file would be /var/www/html/moodle/.htaccess, or wherever else you have Moodle installed.

Note that for an 'out-of the box' Moodle intallation, you will have to add the .htaccess file (i.e. it probably won't be there already). However, there is a default htaccess file, /moodle/lib/htaccess, which you can edit (if necessary), copy into your /moodle directory and rename as .htaccess.

Hope this helps
У адказ на Geoffrey Rowland

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Bettie Donovan -
Hopefully, someone will read this as the thread is somewhat outdated. I have read all of the responses here. I do not find a php.ini file anywhere to modify. Moodle is being hosted on an OS X server running 10.4.9. Is anyone familiar with the Mac side of things that they might be able to point me in the right direction for increasing the allowed size for file uploads.
Thanks so much.
Bettie
У адказ на Bettie Donovan

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Ralf Krause -
Выява Particularly helpful Moodlers Выява Plugin developers Выява Translators
It's not easy to help you. I really know a lot of things about Mac OS X but I can't see what kind of Moodle installation you are running. Do you use my Moodle4Mac package or do you use something else?

http://docs.moodle.org/en/Complete_Install_Packages_for_Mac_OS_X
http://docs.moodle.org/en/Step-by-step_Guide_for_Installing_Moodle_on_Mac_OS_X_10.4_Client
У адказ на Ralf Krause

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Bettie Donovan -
I aplogize for not being more specific. Moodle 1.8.1 is running on my elementary school's web server. I did not use Moodle4Mac as it appeared it was for the client not the server. I downloaded and installed the standard Moodle package for this reason and MySQL as separate packages. Everything is running, but I have yet to do much with the courses due to the file size limit. I need to increase it and the PHP memory as well.

There is absolutely no php.ini file on the web server. I used spotlight to try and locate it. Since I have not done much with the present setup, should I download Moodle4Mac, install and run this evrsion? Is this easier to edit the settings for what I need? Just concerned that this package appeared to be for the client end.

Even though my web server is public, Moodle is not going to be available to the public. It will be password protected as it is for my staff for professional development only.

Thanks.
Bettie
У адказ на Bettie Donovan

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Ralf Krause -
Выява Particularly helpful Moodlers Выява Plugin developers Выява Translators
Please look to http://www.entropy.ch/software/macosx/php/
There is a FAQ with a possible answer to your question. I did not install this software myself but this seems to be a hint to your problem.

Where is the php.ini file?
At /usr/local/php5/lib/php.ini (/usr/local/php/ for PHP version 4). I have included the “recommended” file as delivered by the PHP group.


You tried to search with Spotlight but you could not find the file? I think that the reason for this fact are the different rights on the file system and its folders. Spotlight does not have the right to look into admin folders.

If you have an installation without MAMP and Moodle4Mac I should use it. MAMP and Moodle4Mac are useful for local installations but both have security problems with the admin password and the admin rights.

Regards, Ralf
У адказ на Bettie Donovan

Re: Detailed instructions to increase the maximum allowed size for uploaded files

John Patten -

Hi Bettie...

We run Moodle on Mac OS X servers....

FWIW, I did a couple presentations in the Spring that ran through setting up Moodle on a little MacMini. There was a secton in the handouts on how to increase the file size upload setting, etc. etc.

I was planning on starting a site dediicated to  Moodle use at the K12 level, but alas, time has not allowed my much in the form of effort to get the site going.

But, there is a PDF on the site under presentation handouts that walks through the installation of Moodle on a MacMini.  You have to create an account on the site, but once it is created you can download the complete "How-to" guide.

it may help with getting the file size upload limit changed.

the site is: http://moodlicio.us/moodle

Cheers!

У адказ на Bettie Donovan

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Iñaki Arenaza -
Выява Core developers Выява Documentation writers Выява Particularly helpful Moodlers Выява Peer reviewers Выява Plugin developers
If you have Moodle already up and running, the esasiest way to find php.ini is by browsing http://your.moodle.site/admin/phpinfo.php

You'll get a very detailed paged with all the PHP settings and enabled extensions. You need to look for the "Configuration File (php.ini) Path" setting or "Loaded configuration file" (the setting name varies between PHP 4.x and 5.x, and the Unix and Windows version of PHP).

Saludos. Iñaki.
У адказ на Iñaki Arenaza

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Bettie Donovan -
Thank you for all of the assistance. I am posting this for anyone who may need to work their way throught this on an OS X web server running 10.4.9 and moodle 1.8.1, not MAMP.

I did NOT have a php.ini file anywhere on my web server. This is not a local install but a web server. I believe the difference is the creation and location of the files.

Logged in as root. Launched TexEdit. Opened the texedit preferences. Changed the format options under new document tab to plain text. Under the open and save tab, unchecked the add.txt extension to plain text files. Quit texedit.

In the finder, Go>Go to folder. Enter /etc
This is where the php.ini file should be. Instead there is a php.ini.default file. Somewhere in the threads, there is a post from someone who also had the same situation.

I opened this php.ini.default file with texedit. Made the changes I needed and saved. Duplicated the file and resaved as php.ini. Now, both of these files are in this directory. Restared the server.

I can now upload 80MB files. I have checked my PHP info page in moodle and it now points directly to the php.ini file I created.
Hope this helps someone else. Assistance from the Apple systems engineer who supports the Florida school district I work in provided some of these directions.
Bettie
У адказ на Josep M. Fontana

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Jack Drolet -
Hi,

I have edited the php.ini file and copied it into every directory.

My problem is that I don't understand what apache is and whether or not I'm using it. My webhost is bluehost, and there is something there that allows you to create an Apache handler.

However, if I'm looking through files and folders in my ftp program, I don't see an Apache folder, so I can't find the file /etc/httpd/conf/httpd.conf
In the FAQ it says to edit that file first.

Thanks to anyone who can help.

Jack


У адказ на Jack Drolet

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Robert Killinger -
I am not sure if bluehost will give you SSH access but if it does then SSH into your server on bluehost, I use PuTTY. Then go to /etc/httpd/conf/httpd.conf
Use vi or another editor to edit the file. I like to use nano. I would make a backup first before doing anything. Also, I think you should read up on some basic Linux commands first. There is a lot of good stuff out there on the internet.
У адказ на Josep M. Fontana

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Savanah Fahrney-Day -
I'm not sure what I'm doing here. I want to change my upload limits so I can move my course to a new site, but don't know how to do any of this.

My host is Lunarpages and I have access to the Cpanel and file manager. I just don't know where to look for the php.ini or .htaccess files or how to modify them once I locate them.

Help please!

Savanah
У адказ на Savanah Fahrney-Day

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Savanah Fahrney-Day -
Never mind. It must be one of my blonde days.

I've got it fixed now.

Thanks,
Savanah
У адказ на Josep M. Fontana

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Jonathan List -
I have done it all. I've modified the system wide php.ini files correctly.

Interestingly enough, running PHP 5.2 on Ubuntu, if I run:

echo phpinfo();

I get a notification that my PHP max upload size is 20M. When I run the Moodle phpinfo(); it tells me that my max upload is 2M.

I have attempted to modify .htaccess, using the default version included in the moodle/lib/

There are no wandering copies of php.ini on the system (It's a clean install)

Security->Site Policies max bytes is set to 20972544

Still, I am stymied. I have even, not currently, added two zeroes to the end of that max bytes value to no avail.

Any input would be greatly appreciated.
У адказ на Jonathan List

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Marc Grober -
Why don't you share you file...... Many times folks forget that there are TWO file size changes that need to be changed.

Are you running php as cgi or as an apache mod, and if the latter, did you restart apache?

Additionally, can we assume that this is not a shared host and that you have not attempted to modify php settings via apache directives in conf or htaccess files?
У адказ на Marc Grober

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Jonathan List -
Already adjusted post_max and max_upload_filesize to 20M

PHP is running as an apache mod. I've restarted apache as well as the whole machine.

It's not a shared host, but I attempted to modify the php settings in the htaccess file and pointed apache2 to allow the htaccess file to adjust things. This latter part (htaccess) I did in a desperate attempt to get moodle to recognize the change.

Like I said, a file that reads:

<?php

echo phpinfo();

?>

yeilds a result of everything being max 20M. But the Moodle phpinfo(); still tells me that I got 2M.

jsl
У адказ на Jonathan List

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Marc Grober -
Moodle should be using the php.ini that is access by the info page, and it should tell you the specific location of that file, so would you want to zip that up and post it? Do your php.ini lines look exactly like these?

; Maximum size of POST data that PHP will accept.
post_max_size = 20M
; Maximum allowed size for uploaded files.
upload_max_filesize = 20M

And when you go into the Moodle admin GUI to set Moodle max upload file size, does the drop down go up to your PHP max or does it go no higher than 2M?
У адказ на Jonathan List

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Jonathan List -
Ubuntu's default Apache setup has *each* application given it's own apache2.conf file in a /etc/application directory.

This means that, if you're running Ubuntu, you need to edit:

/etc/php*/apache2/php.ini

AND

/etc/moodle/apache.conf

The lines you need to edit in php.ini are:

post_max_size

upload_max_filesize

And in apache.conf:

php_value post_max_size

php_vaule upload_max_filesize

I feel lame that I didn't figure this out more quickly, but I hope my posting this will help people out!

Jonathan
У адказ на Jonathan List

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Marc Grober -
Where did that doc on custom php.ini go after the link from 'installing moodle' was deleted? ;=}

Yes, this is certainly a gotcha to be identified, but what I would like to know, jonathan, is what finally tipped you off to the file issue?

BTW, I posted some resources regarding how php.ini is sourced, which of course can be helpful in working through such issues and was wondering what you think of where such info should be placed in Moodle docs.....
У адказ на Josep M. Fontana

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Purifying Grace -
Hello,

I am very new to moodle, and I do not know PHP. However, I am a quick learner. I have moodle installed. My site is hosted via godaddy.com. I have found my php.ini file; however, whenever I open it with a text editor I cannot find:

php_value upload max_filesize 20971520
php_value post_max_size 20971520


Currently, mine is set at the default, 8MB; however, I want to change this to 100MB. Can anyone give me step-by-step instructions? I don't mind going to different posts, so a list of links would be fine.

How do I edit php.ini? I just need to be able to upload SCORM courses of upward 100MB made via Captivate, etc.

Any and all help will be greatly appreciated.

Thanks!

Travis
У адказ на Purifying Grace

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Steven A -
I can't promise that these instructions will work because every hosting company has their own policy and configuration regarding php.ini file, but give this a shot:

  1. Change the post_max_size and the upload_max_filesize in the php.ini file to the values that you want. For example,
  • upload_max_filesize =100M
  • post_max_size = 100M

Copy the updated php.ini file to the following five folders:
  • public_html
  • moodle/admin
  • moodle/course
  • moodle/files
  • root of your moodledata directory

Log in to your site and go to Site Administration/Security/Site policies and change the “Maximum uploaded file size” to either "Server Limit" or your new max limit and save.
You can edit the php.ini file with any text editor. If you're on windows, Notepad will do. However, if you want to upload huge files (>10MB), why not use an FTP client like FileZilla? It's much more efficient as you can bulk upload. Good luck!

У адказ на Steven A

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Purifying Grace -
Whenever I open the php.ini file I don't see upload_max_filesize or post_max_size. Oh dear! Do I just create the lines?

This is what it reads:
register_globals = off
allow_url_fopen = off

expose_php = Off
max_input_time = 60
variables_order = "EGPCS"
extension_dir = ./
upload_tmp_dir = /tmp
precision = 12
SMTP = relay-hosting.secureserver.net
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset="

[Zend]
zend_extension=/usr/local/zo/ZendExtensionManager.so
zend_extension=/usr/local/zo/4_3/ZendOptimizer.so
session.bug_compat_warn=0

Currently, I do use FileZilla; however, where do I upload a scorm course file (*.zip)?

Travis
У адказ на Steven A

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Purifying Grace -
Also, if I were to use FileZilla, where would I upload the course? Which file directory?
У адказ на Purifying Grace

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Steven A -
It might be a good idea to contact your hosting company about what you have access to in the php.ini file. Adding lines might work, but I've never had to try.

"Upload the course"? Courses have to be created in Moodle; then it's possible to upload content to the course. Your courses are in the moodledata directory. They're all numbered (1, 2, 3, 4, etc.). Find the course that you want and upload your content to it.
У адказ на Steven A

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Clark Moodler -

Steven A's post here was the most useful I've seen on this topic! I'm adding the list of directories to put the php.ini file into the docs.moodle.org wiki where it belongs!

cheers,
clark

У адказ на Clark Moodler

Re: Detailed instructions to increase the maximum allowed size for uploaded files

yasir Muhammad -
i'm using IIS where can i find php.ini
У адказ на yasir Muhammad

Re: Detailed instructions to increase the maximum allowed size for uploaded files

John Szkudlapski -

Yasir

Dependant on were it was installed it could be a similar location to *one* of the following 

C:\PHP or c:\Program Files\PHP

c:\PHP4 or c:\Program Files\PHP4

C:\php5 or C:\Program Files\PHP5

Have you tried searching the server computer for the location of php.ini ?

У адказ на Josep M. Fontana

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Moodle Mojo -
hi Josep,

i just read your post. I am still unclear about what you meant by what you wrote below. I have created a .htaccess file, now I am creating a httpd.conf file in Apache. I cannot fish out the exact code in your post. Can you please send me the EXACT code of what should be in my httpd.conf file?

thanks.


Thus, in order for the instructions in the .htaccess file to take effect, the file httpd.conf in your Apache installation must contain the following lines:

</Directory>

# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.

<Directory "/full path to your moodle directory">

And the following overrides must be enabled:

# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit

AllowOverride Options Indexes

By default "AllowOverride" is set to none, which would mean that the .htaccess file would not be enabled and would thus not work.

Once the appropriate Overrides are enabled, you need to make sure your .htaccess file contains something like the following:

### Fourthly, sometimes Apache limits the size of uploaded files
### (this is a separate limit to the one in PHP, see below).
### The setting here turns off this limitation

LimitRequestBody 0

### These are optional - you may not want to override php.ini
### To enable them, remove the leading hash (#)

php_value upload_max_filesize 20971520
php_value post_max_size 20971520

У адказ на Josep M. Fontana

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Holger Striegl -
Hi,

first thanks for the "how-to-amnual" above. Worked out fine for me.

Concerning the max upload filesize for course rooms, I am facing another problem now - maybe someone can help me out here падморгваньне

I set the max filesize for a course room up to 100MB, as video material is used by the teachers of the course. But the effect is as well, that students are now able to upload files up to that ammount (100MB) as well (e.g. high res fotos for their user profile, which are not necessary, but available due to the max file size of 100MB here). Now lots of "unnecessary" data is produced. Is there a possibility to set the max filesize in a certain context? E.G. concerning upload of (profile) fotos: only up to 1 MB should be allowed. Concerning upload of Video material, up to 100MB should be allowed.

Any suggestions here падморгваньне

Cheers,
Holger
У адказ на Josep M. Fontana

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Carlo Grandi -
if you use php as an Apache module, you should modify etc/php5/apache2/php.ini.
if you use php as an Fastcgi, you should modify etc/php5/cgi/php.ini.
У адказ на Carlo Grandi

Re: Detailed instructions to increase the maximum allowed size for uploaded files

William Felton -

So I just solved this problem on my MAc OS X server, and I need to mention it here.  I read every stick of documentation on this, but the solution was very simple but not anywhere that I found.  Please note that this solution will not work for everyone, but it did in my case.

I looked at the "PHP Info" page under Administration and saw this

Configuration File (php.ini) Path:      /etc
Loaded Configuration File:         (none)
Scan this dir for additional .ini files:      (none)
additional .ini files parsed:        (none)

Down lower:

post_max_size:    8M   <------

upload_max_filesize:  2M    <-----This is what I wanted to change

I found a php.ini.default file in the /etc directory and assumed that the server was using this and had made the appropriate changes to this file to change the upload size-WRONG-

Eventually, I made a copy of the php.ini.default file in the /etc directory and called it php.ini.  BINGO.

The PHP Info now shows this and the upload sizes have been changed

Configuration File (php.ini) Path:      /etc
Loaded Configuration File:         /private/etc/php.ini
Scan this dir for additional .ini files:      (none)
additional .ini files parsed:        (none)

Hope this helps someone out there.

Willy Felton

У адказ на Josep M. Fontana

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Sophie Ricci -

Hi,

My moodle site is externally hosted. CPanel tells me : php variable upload_max_filessize = 64 MO.

However in moodle, files above 8MO are rejected, even if I choose in moodle administration the option "server file size limit". Have you got any hints about this issue, that I have to fix shortly ? Thank you by advance.

Best regards.    

У адказ на Sophie Ricci

Re: Detailed instructions to increase the maximum allowed size for uploaded files

G L -

Have you also upped the php "post_max_size"?  And once you set moodle's admin option to "server size limit", you still need to go into a specific course's options and set the max upload size there.  I'm pretty sure that the admin -> Security -> Site Policies -> Maximum Uploaded File Size setting (I assume that's the one you're talking about) is just setting the max that can be configured into a course.   Once that's raised, then you'll have larger choices in the menu for some particular course's Settings -> Max Upload Size.

-glenn

У адказ на G L

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Sophie Ricci -

Thanks for these tips. I'll try.

Sophie

У адказ на Sophie Ricci

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Alaa Elkholy -

Hi,

How do I hack Moodle to override upload_max_filesize and post_max_size?

I would like to define my own max upload file size for Moodle.

I donot have access to php.ini as I am using a shared hosting service.

Any idea(s)?

regards

У адказ на Alaa Elkholy

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Marc Grober -
Alaa, 1) just because you are on a shared server does not mean you don't have access to a custom php.ini 2) read the docs as they will explain what you need to know
У адказ на Marc Grober

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Alaa Elkholy -

I contacted my server admin, and they said they are banning custom php.ini.

 

Any ideas?

У адказ на Alaa Elkholy

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Marc Grober -

Alaa,

I take it you reviewed this doc ( http://docs.moodle.org/en/File_upload_size#Modifying_the_.htaccess_file ) and determined that it was also impossible for you to change this parameter through an .htaccess file?  If so I believe that you are stuck.

У адказ на Marc Grober

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Marc Grober -
Alaa, How about if you provide detailed info on what you have specifically done and on you environment?
У адказ на Marc Grober

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Colin Fraser -
Выява Documentation writers Выява Testers

Alaa, as a suggestion, you may want to consider another, more co-operative, service provider, if there is one available. That may save you a lot of trouble and argument. Good luck...

У адказ на Josep M. Fontana

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Pieter Portier -

I'm a newbe at PHP and Linuxservers.
But in Moodle I opened Administration>Security>PHP-info (as well as the php.ini file) and I found that the max filesize for uploads has been set to 64M and that is big enough for me at this time.

But although I changed the max upload (in Security) to the Server Limit the dropdown menu reads a max of 8M when I try to upload/add a source or Scorm-activity to a course.
Moreover this remark is shown on the left of Course Default Settings at "Moodlecourse | Maxbytes" : Invalid current value: 134217728

Thanks in advance

У адказ на Pieter Portier

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Ann Adamcik -

Did you also go into course settings and increase the upload size there?

У адказ на Ann Adamcik

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Pieter Portier -

When I select a course and open "Edit Settings" the drop-down menu shows the same values from 0kb to 8M.
The option 'Server Limit' or in my case 64M is not available.

У адказ на Pieter Portier

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Marc Grober -

Pieter,

First thing to do is to read all the Moodle docs on this matter (which will address al the questins you might have, and then, if you can't resolve your problem, provide ALL the information that one would need to help you (you will know what information you should offer by virtue of reading the documentation.)

Along the way you will learn about how php.ini is sourced, the various ways php can be called, the various php.ini settingS that should be changed to address items such as you are concerned with, etc.

If something is missing from the docs, or is difficult to find, I am sure that we can quickly fill in the gaps in the documentation. But I check such things regularly, and my experience is that with any of the major search engines the pertinent docs come up pdq (and I am talking about the docs, NOT the fora) .

Good luck and we look forward to your forthcoming posting indicating that you resolved the problem by way of accessing the docs, or found specific gaps in the docs for your system (for which you will provide adequate details as far as php env, moodle version, etc) .

У адказ на Marc Grober

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Pieter Portier -

 

Thank you so much for your response!
I followed your advice and as it appears I've managed to make the changes.

My (hosted) server uses PHP version 5.2.9 and Moodle Version 2.0 is installed.

  • I contacted my host in order to make te php.ini file available to me.
  • Then I used the information as shown in the MoodleDoc "Create .htaccess file" and applied the changes in the php.ini file as well as in the .htaccess file.
  • Last but not least I copied and pasted the php.ini file to my moodle directory and ALL other subdirectories and the job was done.

Now I can upload filesizes up to the server limit.

Thanks again!

У адказ на Pieter Portier

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Derek Chirnside -

Just a quick posting in the longest thread I could find on the topic of upload file sizes.

Is anyone here able to take a quick look at these two pages from the new 2.0 docs and see how complete and/or accurate they are.

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

There is also this: http://docs.moodle.org/20/en/Installing_Moodle/Creating_custom_php.ini_files

Think of this: the problems you had, are they covered in the docs? To the right extent?  Readability etc etc.

У адказ на Derek Chirnside

Re: Detailed instructions to increase the maximum allowed size for uploaded files

John Smigleski -

You have this:

 

Modifying the IIS 7.0/7.5 configuration (Windows Server 2008, Windows Server 2008 R2)

First increase activity and request time outs (allows large files to succeed on slow connections)

FastCGI Settings > Edit (Right-click on PHP application)
Set Process Model > Activity Timeout to '3600' (one hour)
Set Process Model > Request Timeout to '3600' (one hour)

Next set 'Maximum allowed content length'

Request Filtering > Edit Feature Settings:
Set 'Maximum allowed content length' to your desired file size (in bytes) e.g. '536870912' for 512MB (default is approximately 28.6MB)

I'm not sure how to get to the FastCGI Settings. Where is the PHP application that I'm to right-click?
У адказ на John Smigleski

Re: Detailed instructions to increase the maximum allowed size for uploaded files

John Smigleski -

Ok after MUCH searching, I finally found this:

 

Request Filtering > Edit Feature Settings:
Set 'Maximum allowed content length' to your desired file size (in bytes) e.g. '536870912' for 512MB (default is approximately 28.6MB)

It is in IIS manager, under your website name. Double click on Content Filtering and then Edit Feature Settings is on the right side. This was the last step to fix uploading issues.
У адказ на John Smigleski

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Mr. Marc -

We are using Moodle 2.2.1 on Cent OS 5.5

How is the course default setting set?
Maximum upload size?
ours is 15.3MB
But when Php Info runs it says its 16M
for upload max filesize and post max size

У адказ на Mr. Marc

Re: Detailed instructions to increase the maximum allowed size for uploaded files

Ken Task -
Выява Particularly helpful Moodlers

@Mr. Marc ... this whole thread is rather old.

Check for the existence of a dot htaccess file (.htaccess).

From terminal session logged on as root and in the moodle directory:

ls -lR ./*/.htaccess

or

find ./ -name .htaccess

will list the paths to ALL the .htaccess files if they exist.

To view: cat ./pathyousaw/.htaccess

'spirit of sharing', Ken

У адказ на Josep M. Fontana

Re: Detailed instructions to increase the maximum allowed size for uploaded files

michael mckenzie -

Sorry to add to this increasingly long list.

I have a moodle behind a proxy server. I have changed the max upload file size in both to 100 meg.

When i look at the php info I see the master max file size is correct, but the local max file size is 16 meg.

I tried a .htaccess on the moodle directory with no effect.

I changed the limit in /etc/apache/php.ini on the moodle host to 131meg and this was the number that appeared in the master settings column, but nothing I have changed is able to effect the local columns settings.

I have searched for alternate php.ini, and apache limit settings in the apache config file (although i suspect these would not be reflected in the PHP properties.

 

Can anyone suggest another place I could look. there is a 16Msetting in there somewhere giggling at me

 

MM