|
50 | 50 | # Check if php version is supported |
51 | 51 | if [[ ! "$multiphp_v" =~ $version ]]; then |
52 | 52 | echo "ERROR: Specified PHP version is not supported or does not exist." |
53 | | - exit "$E_INVALID"; |
| 53 | + exit "$E_INVALID" |
54 | 54 | fi |
55 | 55 |
|
56 | 56 | # Perform verification if read-only mode is enabled |
@@ -131,14 +131,25 @@ update-rc.d php$version-fpm defaults > /dev/null 2>&1 |
131 | 131 | v_tpl=${version//./} |
132 | 132 | rm -f /etc/php/$version/fpm/pool.d/* |
133 | 133 | cp -f $HESTIA_INSTALL_DIR/php-fpm/dummy.conf /etc/php/$version/fpm/pool.d/ |
134 | | -sed -i "s/9999/99$v_tpl/g" /etc/php/$version/fpm/pool.d/dummy.conf |
| 134 | +sed -i "s/%backend_version%/$version/g" /etc/php/$version/fpm/pool.d/dummy.conf |
135 | 135 | cp -f $HESTIA_INSTALL_DIR/php-fpm/php-fpm.conf /etc/php/$version/fpm/ |
136 | 136 | sed -i "s/fpm_v/$version/g" /etc/php/$version/fpm/php-fpm.conf |
137 | 137 |
|
138 | 138 | # Increase max upload and max post size |
139 | 139 | sed -i "s/upload_max_filesize = 2M/upload_max_filesize = 100M/g" /etc/php/$version/fpm/php.ini |
140 | 140 | sed -i "s/post_max_size = 8M/post_max_size = 100M/g" /etc/php/$version/fpm/php.ini |
141 | 141 | sed -i "s/max_execution_time = 30/max_execution_time = 60/g" /etc/php/$version/fpm/php.ini |
| 142 | +sed -i "s/;max_input_vars = 1000/max_input_vars = 4000/g" /etc/php/$version/fpm/php.ini |
| 143 | + |
| 144 | +# Disable exec and other harmfull php functions |
| 145 | +sed -i "s/disable_functions =.*/disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,exec,system,passthru,shell_exec,proc_open,popen/g" /etc/php/$version/fpm/php.ini |
| 146 | + |
| 147 | +sed -i "s/disable_functions =.*/disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,exec,system,passthru,shell_exec,proc_open,popen/g" /etc/php/$version/cli/php.ini |
| 148 | + |
| 149 | +# Other use full changes |
| 150 | +sed -i "s/;opcache.enable=1/opcache.enable=1/g" /etc/php/$version/fpm/php.ini |
| 151 | +sed -i "s/;opcache.memory_consumption=128/opcache.memory_consumption=512/g" /etc/php/$version/fpm/php.ini |
| 152 | +sed -i "s/;opcache.max_accelerated_files=10000/opcache.max_accelerated_files=100000/g" /etc/php/$version/fpm/php.ini |
142 | 153 |
|
143 | 154 | # Install backend template |
144 | 155 | cp -f $HESTIA_INSTALL_DIR/php-fpm/multiphp.tpl \ |
|
0 commit comments