Răsfoiți Sursa

Increase max file size uploads in PHPMyAdmin/PHPPgAdmin virtual hosts for Apache and Nginx

Emmanuel Bouthenot 8 ani în urmă
părinte
comite
3f5e12c1f3

+ 6 - 0
roles/webserver/templates/apache2/pga_vhost.j2

@@ -23,6 +23,12 @@
         Require all granted
     </Directory>
 
+    <IfModule mod_php5.c>
+        php_admin_value max_execution_time 240
+        php_admin_value upload_max_filesize 128M
+        php_admin_value post_max_size 128M
+    </IfModule>
+
     LogLevel warn
     CustomLog ${APACHE_LOG_DIR}/pga.access.log combined
     ErrorLog ${APACHE_LOG_DIR}/pga.error.log

+ 6 - 0
roles/webserver/templates/apache2/pma_vhost.j2

@@ -21,6 +21,12 @@
 
     Include /etc/phpmyadmin/apache.conf
 
+    <IfModule mod_php5.c>
+        php_admin_value max_execution_time 240
+        php_admin_value upload_max_filesize 128M
+        php_admin_value post_max_size 128M
+    </IfModule>
+
     LogLevel warn
     CustomLog ${APACHE_LOG_DIR}/pma.access.log combined
     ErrorLog ${APACHE_LOG_DIR}/pma.error.log

+ 2 - 1
roles/webserver/templates/nginx/pga_vhost.j2

@@ -21,9 +21,10 @@ server {
     auth_basic_user_file /etc/nginx/auth_admin;
 {% endif %}
 
-    client_max_body_size 32m;
+    client_max_body_size 128m;
 
     location ~ \.php(/|$) {
         include fastcgi_pass_fpm;
+        fastcgi_param PHP_ADMIN_VALUE "max_execution_time=240\nupload_max_filesize=128M\npost_max_size=128M";
     }
 }

+ 2 - 1
roles/webserver/templates/nginx/pma_vhost.j2

@@ -21,9 +21,10 @@ server {
     auth_basic_user_file /etc/nginx/auth_admin;
 {% endif %}
 
-    client_max_body_size 32m;
+    client_max_body_size 128m;
 
     location ~ \.php(/|$) {
         include fastcgi_pass_fpm;
+        fastcgi_param PHP_ADMIN_VALUE "max_execution_time=240\nupload_max_filesize=128M\npost_max_size=128M";
     }
 }