Maximum file size issue

Maximum file size issue

by Perry Way -
Number of replies: 2

Hello everyone, I've got a new situation while attempting to get our old school site back up and running after ransomware attack.

We are on a totally new server now, so I had to set PHP up from scratch again, but this time without a previous php.ini file to compare for settings.

We want to have 200mb as the maximum file size for uploading to Moodle but oddly the settings of 200mb show up in Moodle as 20mb. I'm kind of beside myself really. I've been through all the PHP related help I could find doing strong Duck Duck Go searches, tried just about everything under the sun, including even rebooting the web server machine itself.

Environment. Windows 2019, PHP 7.4.23, IIS Webserver, Wincache plugin for PHP

PHP Settings pertinent to this issue are as follows:

; Maximum size of POST data that PHP will accept.
; Its value may be 0 to disable the limit. It is ignored if POST data reading
; is disabled through enable_post_data_reading.
; http://php.net/post-max-size
;post_max_size = 200M
post_max_size = 0

;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;
; Whether to allow HTTP file uploads.
; http://php.net/file-uploads
file_uploads = On
; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
; http://php.net/upload-tmp-dir
upload_tmp_dir = C:\PHP\Uploads
; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 200M
; Maximum number of files that can be uploaded via a single request
max_file_uploads = 20

Screen shot of what we see in Moodle for where a student would upload a homework assignment:

 screenshot

How can I make 20mb be 200mb as it reads in the php.ini file?


Average of ratings: -
In reply to Perry Way

Re: Maximum file size issue

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I'm not a fan of the 0 = disable settings. I would make it something.

Site administration > Server > PHP info. What does it have to say about those settings on that page? If they're wrong, check near the top of the same page to confirm which php.ini files it's reading. Is it the one you edited?

You've changed the maximum file setting in the course?
Average of ratings: Useful (1)
In reply to Howard Miller

Re: Maximum file size issue

by Perry Way -

Oh Thank you very much Howard for getting me to look further.

I did not know each assignment had an additional max size to them. 

This issue was fixed a long time ago but because the problem was reported to me without a context attached to it, I took it to mean it was a site wide problem. When I fixed the problem I just picked a random course and a random assignment to see what it showed, and it showed 20 mb when that was a restriction placed on that specific assignment by the instructor.

The problem is fixed, and thanks for triggering me to check the assignment settings themselves!