From c89c28eef83bc605ec14ff4bbaa96f29f963b4fa Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Sun, 19 Mar 2023 22:25:10 +0800 Subject: [PATCH] Increase max upload size This increases the standard maximum upload file size to 200M, which is a much more realistic size for development. This also requires a bump in the maximum post size. --- .github/workflows/test_buildx_and_publish.yml | 1 + root/usr/local/bin/moodle-docker-php-ini | 2 +- .../etc/php/conf.d/10-docker-php-moodle.ini | 7 +++++++ tests/fixtures/check-ini.php | 19 ++++++++++++++++--- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test_buildx_and_publish.yml b/.github/workflows/test_buildx_and_publish.yml index d8a2984..ca86125 100644 --- a/.github/workflows/test_buildx_and_publish.yml +++ b/.github/workflows/test_buildx_and_publish.yml @@ -31,6 +31,7 @@ jobs: -e PHP_INI-apc.enabled=0 \ -e PHP_INI-apc.enable_cli=0 \ -e PHP_INI-pcov.enabled=1 \ + -e PHP_INI-upload_max_filesize=20M \ moodle-php-apache docker exec test0 php /var/www/html/test.php docker exec test0 php /var/www/html/check-ini.php diff --git a/root/usr/local/bin/moodle-docker-php-ini b/root/usr/local/bin/moodle-docker-php-ini index fa8cef8..1617438 100755 --- a/root/usr/local/bin/moodle-docker-php-ini +++ b/root/usr/local/bin/moodle-docker-php-ini @@ -4,7 +4,7 @@ set -e echo "Checking for php configuration in environment" -localinifile="/usr/local/etc/php/conf.d/10-local.ini" +localinifile="/usr/local/etc/php/conf.d/20-local.ini" cat <<'EOF' > $localinifile ; -- diff --git a/root/usr/local/etc/php/conf.d/10-docker-php-moodle.ini b/root/usr/local/etc/php/conf.d/10-docker-php-moodle.ini index c5675bf..02acc99 100644 --- a/root/usr/local/etc/php/conf.d/10-docker-php-moodle.ini +++ b/root/usr/local/etc/php/conf.d/10-docker-php-moodle.ini @@ -4,3 +4,10 @@ ; See MDL-71390 for more info. This is the recommended / required ; value to support sites having 1000 courses, activities, users.... max_input_vars = 5000 + +; Increase the maximum filesize to 200M, which is a more realistic figure. +upload_max_filesize = 200M + +; Increase the maximum post size to accomodate the increased upload_max_filesize. +; The default value is 6MB more than the default upload_max_filesize. +post_max_size = 206M diff --git a/tests/fixtures/check-ini.php b/tests/fixtures/check-ini.php index eeb841e..be64a75 100644 --- a/tests/fixtures/check-ini.php +++ b/tests/fixtures/check-ini.php @@ -1,17 +1,17 @@