hidden dynvars
Dynvars for php opcache.
This commit is contained in:
parent
401fd2277d
commit
ebf3d5fd84
3 changed files with 15 additions and 16 deletions
|
@ -1297,9 +1297,12 @@ check_var() {
|
|||
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
|
||||
|
||||
# PHP opcache validate timestamps
|
||||
elif [[ $1 == "php-opcache-timestamps" ]]; then
|
||||
[[ -n $(conf_read php-opcache-reval) && $(conf_read php-opcache-timestamps) =~ ^(0|1)$ ]] && local out=$(conf_read php-opcache-timestamps) || local out="false"
|
||||
# PHP opcache revalidate frequency
|
||||
elif [[ $1 == "php-opcache-reval" ]]; then
|
||||
[[ -n $(conf_read php-opcache-reval) && $(conf_read php-opcache-reval) =~ ^[0-9]+$ && $(conf_read php-opcache-reval) -ge 0 ]] && local out=$(conf_read php-opcache-reval) || local out=2
|
||||
[[ -n $(conf_read php-opcache-reval) && $(conf_read php-opcache-reval) =~ ^[0-9]+$ && $(conf_read php-opcache-reval) -ge 0 ]] && local out=$(conf_read php-opcache-reval) || local out="false"
|
||||
|
||||
# Redis Memory
|
||||
elif [[ $1 == "redis-max-mem" ]]; then
|
||||
|
|
10
lib/install
10
lib/install
|
@ -394,10 +394,18 @@ php_optim() {
|
|||
sudo sed -i -r '/^[;]?opcache.interned_strings_buffer=/c\opcache.interned_strings_buffer=16' /etc/php/$ver/fpm/php.ini
|
||||
sudo sed -i -r '/^[;]?opcache.max_accelerated_files=/c\opcache.max_accelerated_files=100000' /etc/php/$ver/fpm/php.ini
|
||||
sudo sed -i -r '/^[;]?opcache.max_wasted_percentage=/c\opcache.max_wasted_percentage=10' /etc/php/$ver/fpm/php.ini
|
||||
sudo sed -i -r "/^[;]?opcache.revalidate_freq=/c\opcache.revalidate_freq=$(check_var php-opcache-reval)" /etc/php/$ver/fpm/php.ini
|
||||
sudo sed -i -r '/^[;]?opcache.enable_cli=/c\opcache.enable_cli=1' /etc/php/$ver/fpm/php.ini
|
||||
sudo sed -i -r '/^[;]?opcache.enable=/c\opcache.enable=1' /etc/php/$ver/fpm/php.ini
|
||||
|
||||
# Not set, unless non-empty! (hidden dynvars)
|
||||
if [[ $(check_var php-opcache-timestamps) != "false" ]]; then
|
||||
sudo sed -i -r "/^[;]?opcache.validate_timestamps=/c\opcache.validate_timestamps=$(check_var php-opcache-timestamps)" /etc/php/$ver/fpm/php.ini
|
||||
fi
|
||||
if [[ $(check_var php-opcache-reval) != "false" ]]; then
|
||||
sudo sed -i -r "/^[;]?opcache.revalidate_freq=/c\opcache.revalidate_freq=$(check_var php-opcache-reval)" /etc/php/$ver/fpm/php.ini
|
||||
fi
|
||||
|
||||
|
||||
[[ -n $(conf_read timezone) ]] && set_timezone
|
||||
|
||||
sudo sed -i -r "/^[;]?pm =/c\pm = $(check_var php-pm)" /etc/php/$ver/fpm/pool.d/www.conf
|
||||
|
|
|
@ -182,13 +182,6 @@
|
|||
#xmlrpc:limited
|
||||
|
||||
|
||||
# Number of lines shown when log command is used (tail)
|
||||
# Values: numeric int
|
||||
# Default: 10
|
||||
###########################
|
||||
#log-lines:10
|
||||
|
||||
|
||||
# HTTP Header: Cache Control
|
||||
# Values: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
|
||||
# Default: no-cache
|
||||
|
@ -292,6 +285,7 @@
|
|||
###########################
|
||||
#php-pm:dynamic
|
||||
|
||||
|
||||
# PHP number of child processes to be created
|
||||
# Values: numeric int
|
||||
# Default: <variable> (calculated based on your server resources)
|
||||
|
@ -321,6 +315,7 @@
|
|||
###########################
|
||||
#php-max-files:20
|
||||
|
||||
|
||||
# PHP How many input variables may be accepted
|
||||
# Values: numeric int
|
||||
# Default: 5000
|
||||
|
@ -328,13 +323,6 @@
|
|||
###########################
|
||||
#php-max-input-vars:5000
|
||||
|
||||
# PHP OpCache Revalidate Frequency
|
||||
# Values: numeric int (seconds)
|
||||
# Default: 2
|
||||
# Note: Raising this variable can cause developers to notice that changes in PHP code not taking effect.
|
||||
# Note: A good value (10-15), production servers with not frequent changes in code (60).
|
||||
###########################
|
||||
#php-opcache-reval:2
|
||||
|
||||
# PHP Path_Info
|
||||
# Values: boolean (true/false)
|
||||
|
|
Loading…
Add table
Reference in a new issue