From 634aac10865b3c559f8712c8f2225ee108e0ee0f Mon Sep 17 00:00:00 2001 From: Oleg Kainov Date: Fri, 22 Jan 2021 20:53:30 +0100 Subject: [PATCH] fix issue with wrong upload_size parsing Apparently "upload_max_filesize" INI directive was giving output like "2M" which was unparseable by Mantis. Instead of setting Mantis config, increase base php.ini parameters to ~50MB and remove this line at all. Fixes #5 --- Dockerfile | 2 ++ README.md | 3 +++ config_inc.php | 4 ---- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 273abde..eaa402c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,6 +36,8 @@ RUN set -xe \ && echo 'display_errors = Off ' >> "$PHP_INI_DIR/conf.d/mantis.php.ini" \ && echo 'log_errors = On ' >> "$PHP_INI_DIR/conf.d/mantis.php.ini" \ && echo 'error_log = /dev/stderr' >> "$PHP_INI_DIR/conf.d/mantis.php.ini" \ + && echo 'upload_max_filesize = 50M ' >> "$PHP_INI_DIR/conf.d/mantis.php.ini" \ + && echo 'post_max_size = 51M ' >> "$PHP_INI_DIR/conf.d/mantis.php.ini" \ && echo 'register_argc_argv = Off' >> "$PHP_INI_DIR/conf.d/mantis.php.ini" COPY config_inc.php /var/www/html/config/config_inc.php diff --git a/README.md b/README.md index 7441bb5..1c8d137 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,9 @@ $g_window_title = 'Title of your MantisBT instance'; // Default is useless 5 minutes $g_reauthentication_expiry = 60 * 60; +// Increase upload file size from default 5MB +$g_max_file_size = 5 * 1024 * 1024; + // Enable anonymous access $g_allow_anonymous_login = true; diff --git a/config_inc.php b/config_inc.php index 94d6cbd..8c2c13c 100644 --- a/config_inc.php +++ b/config_inc.php @@ -10,10 +10,6 @@ $g_db_password = getenv('MYSQL_PASSWORD') !== false ? getenv('MYSQL_PASSWO $g_crypto_master_salt = getenv('MASTER_SALT'); -# To fix the warning -# max_file_size MantisBT option is less than or equal to the upload_max_filesize directive in php.ini -$g_max_file_size = ini_get("upload_max_filesize"); - # Configure email $g_webmaster_email = getenv('EMAIL_WEBMASTER') !== false ? getenv('EMAIL_WEBMASTER') : null;