diff --git a/ehcp/ehcpforceupdate.sh b/ehcp/ehcpforceupdate.sh index e2b3a94..a7ab0f8 100755 --- a/ehcp/ehcpforceupdate.sh +++ b/ehcp/ehcpforceupdate.sh @@ -2164,6 +2164,11 @@ function configurePHPIni(){ # Create /var/www/php_sessions directory to store PHP session files for the default configuration file only # All defined vhosts have their own php_sessions directory for permissions sake... setupPHPSessionsDir + + # Bump limit in nginx for max client size + if [ -e "/etc/nginx/nginx.conf" ]; then + sed -i "s#client_max_body_size.*#client_max_body_size 1024m;#g" "/etc/nginx/nginx.conf" + fi } function ModifyPHPIniConfigForFile(){ @@ -2175,11 +2180,11 @@ function ModifyPHPIniConfigForFile(){ # Turn error displaying on sed -i "s#^display_errors.*#display_errors = On#g" "$PHPINIFILE" - # Set upload limit higher to 50MB (We don't live in the 90s anymore...) - sed -i "s#^upload_max_filesize.*#upload_max_filesize = 50M#g" "$PHPINIFILE" + # Set upload limit higher to 1024MB (We don't live in the 90s anymore...) + sed -i "s#^upload_max_filesize.*#upload_max_filesize = 1024M#g" "$PHPINIFILE" - # Set max post size to 50MB (We don't live in the 90s anymore...) - sed -i "s#^post_max_size.*#post_max_size = 50M#g" "$PHPINIFILE" + # Set max post size to 1024MB (We don't live in the 90s anymore...) + sed -i "s#^post_max_size.*#post_max_size = 1024M#g" "$PHPINIFILE" # And for gods sake, please set error reporting so that it doesn't annoy anyone! sed -i "s#^error_reporting.*#error_reporting = E_ALL \& \~E_DEPRECATED \& \~E_NOTICE \& \~E_STRICT#g" "$PHPINIFILE" diff --git a/ehcp/etc/nginx/nginx.conf b/ehcp/etc/nginx/nginx.conf index 6b3b3a7..3aedc4d 100755 --- a/ehcp/etc/nginx/nginx.conf +++ b/ehcp/etc/nginx/nginx.conf @@ -44,7 +44,7 @@ http { # Nginx default value was 1 MB and therefore all uploads exceeding 1 MB was # getting "413 Request Entity Too Large" error.Script default is 64 MB. # Remember to change the settings for upload size in php.ini as well. - client_max_body_size 64m; + client_max_body_size 1024m; include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; diff --git a/ehcp/etc/nginx_nonssl/nginx.conf b/ehcp/etc/nginx_nonssl/nginx.conf index bc18160..da4011b 100755 --- a/ehcp/etc/nginx_nonssl/nginx.conf +++ b/ehcp/etc/nginx_nonssl/nginx.conf @@ -44,7 +44,7 @@ http { # Nginx default value was 1 MB and therefore all uploads exceeding 1 MB was # getting "413 Request Entity Too Large" error.Script default is 64 MB. # Remember to change the settings for upload size in php.ini as well. - client_max_body_size 64m; + client_max_body_size 1024m; include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; diff --git a/ehcp/etc/nginx_ssl/nginx.conf b/ehcp/etc/nginx_ssl/nginx.conf index 0296d1c..7102c42 100755 --- a/ehcp/etc/nginx_ssl/nginx.conf +++ b/ehcp/etc/nginx_ssl/nginx.conf @@ -43,7 +43,7 @@ http { # Nginx default value was 1 MB and therefore all uploads exceeding 1 MB was # getting "413 Request Entity Too Large" error.Script default is 64 MB. # Remember to change the settings for upload size in php.ini as well. - client_max_body_size 64m; + client_max_body_size 1024m; include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; diff --git a/ehcp/etc/nginx_sslonly/nginx.conf b/ehcp/etc/nginx_sslonly/nginx.conf index 083b099..54fc6f5 100755 --- a/ehcp/etc/nginx_sslonly/nginx.conf +++ b/ehcp/etc/nginx_sslonly/nginx.conf @@ -43,7 +43,7 @@ http { # Nginx default value was 1 MB and therefore all uploads exceeding 1 MB was # getting "413 Request Entity Too Large" error.Script default is 64 MB. # Remember to change the settings for upload size in php.ini as well. - client_max_body_size 64m; + client_max_body_size 1024m; include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; diff --git a/ehcp/install_main.sh b/ehcp/install_main.sh index 17d7148..7023f20 100755 --- a/ehcp/install_main.sh +++ b/ehcp/install_main.sh @@ -1866,6 +1866,11 @@ function configurePHPIni(){ # Create /var/www/php_sessions directory to store PHP session files for the default configuration file only # All defined vhosts have their own php_sessions directory for permissions sake... setupPHPSessionsDir + + # Bump limit in nginx for max client size + if [ -e "/etc/nginx/nginx.conf" ]; then + sed -i "s#client_max_body_size.*#client_max_body_size 1024m;#g" "/etc/nginx/nginx.conf" + fi } function ModifyPHPIniConfigForFile(){ @@ -1877,17 +1882,17 @@ function ModifyPHPIniConfigForFile(){ # Turn error displaying on sed -i "s#^display_errors.*#display_errors = On#g" "$PHPINIFILE" - # Set upload limit higher to 50MB (We don't live in the 90s anymore...) - sed -i "s#^upload_max_filesize.*#upload_max_filesize = 50M#g" "$PHPINIFILE" + # Set upload limit higher to 1024MB (We don't live in the 90s anymore...) + sed -i "s#^upload_max_filesize.*#upload_max_filesize = 1024M#g" "$PHPINIFILE" - # Set max post size to 50MB (We don't live in the 90s anymore...) - sed -i "s#^post_max_size.*#post_max_size = 50M#g" "$PHPINIFILE" + # Set max post size to 1024MB (We don't live in the 90s anymore...) + sed -i "s#^post_max_size.*#post_max_size = 1024M#g" "$PHPINIFILE" # And for gods sake, please set error reporting so that it doesn't annoy anyone! sed -i "s#^error_reporting.*#error_reporting = E_ALL \& \~E_DEPRECATED \& \~E_NOTICE \& \~E_STRICT#g" "$PHPINIFILE" - # Set max execution time higher to 100 seconds - sed -i "s#^max_execution_time.*#max_execution_time = 100#g" "$PHPINIFILE" + # Set max execution time higher to 180 seconds + sed -i "s#^max_execution_time.*#max_execution_time = 180#g" "$PHPINIFILE" # Configure opcache "properly" for PHP 5.5.x and up hasOpCache=$(cat "$PHPINIFILE" | grep -o "^\[opcache\]")