Explorar el Código

php

8.2 support added.
Intl mandatory in update for old stacks.
Max input vars in conf file.
Cristhian Martínez Ochoa hace 2 años
padre
commit
91d9462425
Se han modificado 4 ficheros con 23 adiciones y 2 borrados
  1. 5 1
      lib/general
  2. 1 0
      lib/install
  3. 11 1
      lib/update
  4. 6 0
      templates/general/conf

+ 5 - 1
lib/general

@@ -7,7 +7,7 @@
 readonly app_version="1.17.0"
 readonly svr_version="1.8"
 readonly os_ubuntu_supported=(bionic focal jammy) # https://ubuntu.com/about/release-cycle
-readonly php_supported=(7.4 8.0 8.1) # https://www.php.net/supported-versions.php
+readonly php_supported=(7.4 8.0 8.1 8.2) # https://www.php.net/supported-versions.php
 readonly php_default="8.1"
 readonly mysql_supported=(10.4 10.5 10.6) # https://mariadb.com/kb/en/mariadb-server-release-dates/
 readonly mysql_default="10.6"
@@ -1288,6 +1288,10 @@ check_var() {
 			[[ $((3*$cores)) =~ ^[0-9]+ && $((3*$cores)) -ge 6 ]] && local out=$((3*$cores)) || local out=6
 		fi
 	
+	# PHP max input vars
+	elif [[ $1 == "php-max-input-vars" ]]; then
+		[[ -n $(conf_read php-max-input-vars) && $(conf_read php-max-input-vars) =~ ^[0-9]+$ && $(conf_read php-max-input-vars) -gt 0 ]] && local out=$(conf_read php-max-input-vars) || local out=5000
+	
 	# Redis Memory
 	elif [[ $1 == "redis-max-mem" ]]; then
 		[[ -n $(conf_read redis-max-mem) && $(conf_read redis-max-mem) =~ ^[0-9]+$ && $(conf_read redis-max-mem) -le 100 ]] && local out=$(conf_read redis-max-mem) || local out=10

+ 1 - 0
lib/install

@@ -393,6 +393,7 @@ php_optim() {
 	sudo sed -i -r "/^[;]?max_file_uploads =/c\max_file_uploads = $(check_var php-max-files)" /etc/php/$ver/fpm/php.ini
 	[[ $(check_var php-max-mem) -gt $(($(check_var max-mb-uploads)+1)) ]] && local phpmem=$(check_var php-max-mem) || local phpmem=$(($(check_var max-mb-uploads)+10))
 	sudo sed -i -r "/^[;]?memory_limit =/c\memory_limit = ${phpmem}M" /etc/php/$ver/fpm/php.ini
+	sudo sed -i -r "/^[;]?max_input_vars =/c\max_input_vars = $(check_var php-max-input-vars)" /etc/php/$ver/fpm/php.ini
 	
 	sudo sed -i -r "/^[;]?opcache.memory_consumption=/c\opcache.memory_consumption=$(check_var php-max-mem)" /etc/php/$ver/fpm/php.ini
 	sudo sed -i -r '/^[;]?opcache.interned_strings_buffer=/c\opcache.interned_strings_buffer=8' /etc/php/$ver/fpm/php.ini

+ 11 - 1
lib/update

@@ -267,6 +267,16 @@ onesix_to_oneseven() {
 }
 
 
+# v1.17.0
+oneseven_to_oneight() {
+	# We are doing here, not before, just because is now mandatory, WP health is giving messages!!
+	if [[ $(conf_read php) == "true" ]]; then
+		sudo apt update
+		sudo apt -y install php$(conf_read php-ver)-intl
+	fi
+}
+
+
 # Version numbers without point
 [[ ${oldver//.} -lt 11 ]] && onezero_to_oneone
 [[ ${oldver//.} -lt 12 ]] && oneone_to_onetwo
@@ -275,7 +285,7 @@ onesix_to_oneseven() {
 [[ ${oldver//.} -lt 15 ]] && onefour_to_onefive
 [[ ${oldver//.} -lt 16 ]] && onefive_to_onesix
 [[ ${oldver//.} -lt 17 ]] && onesix_to_oneseven
-
+[[ ${oldver//.} -lt 18 ]] && oneseven_to_oneight
 
 sudo webinoly -server-reset
 echo "${gre}Your server-configuration has been successfully updated!${end}"

+ 6 - 0
templates/general/conf

@@ -320,6 +320,12 @@
 ###########################
 #php-max-files:20
 
+# PHP How many input variables may be accepted
+# Values: numeric int
+# Default: 5000
+# Note: Limit is applied to $_GET, $_POST and $_COOKIE superglobal separately.
+###########################
+#php-max-input-vars:5000
 
 # PHP Path_Info
 # Values: boolean (true/false)