Note: You are currently viewing documentation for Moodle 2.9. Up-to-date documentation for the latest stable version of Moodle may be available here: Jon Witts/file-upload-v2.

User:Jon Witts/file-upload-v2: Difference between revisions

From MoodleDocs
No edit summary
mNo edit summary
Line 3: Line 3:
File Upload sizes are restricted in a number of different places. The list below shows the order of inheritance that file upload sizes follow.
File Upload sizes are restricted in a number of different places. The list below shows the order of inheritance that file upload sizes follow.


#PHP Server level - [[File_upload_size]]
#PHP Server level - [[File_upload_size]]
#Moodle site level - [[Site_policies]]
#Moodle site level - [[Site_policies]]
#Course level - [[Course_settings]]
#Course level - [[Course_settings]]
#Activity level - [[Adding/editing_a_forum]], [[Upload_a_single_file_assignment]] and [[Advanced_uploading_of_files_assignment]]
#Activity level - [[Adding/editing_a_forum]], [[Upload_a_single_file_assignment]] and [[Advanced_uploading_of_files_assignment]]


As you can see from the list above, it is the PHP server level that has the greatest precedence. So to increase the file upload size in Moodle we must first adjust this setting. Before we try to adjust any settings in PHP though it is good to know what is set already. We find this out by using a phpinfo script.
As you can see from the list above, it is the PHP server level that has the greatest precedence. So to increase the file upload size in Moodle we must first adjust this setting. Before we try to adjust any settings in PHP though it is good to know what is set already. We find this out by using a phpinfo script.

Revision as of 21:32, 8 March 2010

Probably the most frequently asked question in the Moodle.org Using Moodle forums is "How do I increase the upload file size limit?"

File Upload sizes are restricted in a number of different places. The list below shows the order of inheritance that file upload sizes follow.

  1. PHP Server level - File_upload_size
  2. Moodle site level - Site_policies
  3. Course level - Course_settings
  4. Activity level - Adding/editing_a_forum, Upload_a_single_file_assignment and Advanced_uploading_of_files_assignment

As you can see from the list above, it is the PHP server level that has the greatest precedence. So to increase the file upload size in Moodle we must first adjust this setting. Before we try to adjust any settings in PHP though it is good to know what is set already. We find this out by using a phpinfo script.

PHP Info Script

Create a phpinfo() page or locate the phpinfo section in your Moodle, as per the instructions here: phpinfo

At the very top of the phpinfo page you will see the version of PHP that your server is running. See the relevant section below for information on how to proceed.

PHP Version is 5

If you are using PHP 5, there may be many php.ini files on your server, but only one will be the active one. Modifying any copy other than the active one will do absolutely no good whatsoever. To find the active one, do the phpinfo thing. In the output, near the top of the page, is an item labeled Configuration File (php.ini) Path. This will tell you exactly where the active file is. This is the php.ini that your PHP install is reading.

PHP Version is 4

If you are using PHP 4 you will need a php.ini file in every folder (directory) with php script files.

What web server are you using?

Apache

If you are using an Apache web server you can use .htaccess files to over ride the php.ini settings, or you can edit the active php.ini files on your server.

IIS

.... edit php.ini ?! ...

Other

??

How is php running on your web server?

The manner in which PHP is running on your web server will determine if you need to restart your web server daemon or not to apply changes you make to the php.ini file.

You can find out how your web server is running PHP by looking at this section of your phpinfo page: Apache2Handler > Loaded Modules Section.

mod_php5 is present

You are running PHP as an Apache Module. You will need to restart Apache to make changes to your php.ini file apply.

??

What access do you have to the server?

To make changes to the main php.ini file you will need administrative access to the server...

Local / Full access to server

...

Shared / Hosted access to server

...