Files
VPS-scripts_Web-V2/SubModules/php-fpm/conf.sh

37 lines
1.7 KiB
Bash

systemctl stop $phpFPMService
###############
# PHP-FPM #
###############
sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g' "$phpMainConf"
sed -i 's/;opcache.memory_consumption=128/opcache.memory_consumption=256/g' "$phpMainConf"
sed -i 's/;opcache.enable=1/opcache.enable=1/g' "$phpMainConf"
sed -i 's/;opcache.interned_strings_buffer=8/opcache.interned_strings_buffer=8/g' "$phpMainConf"
sed -i 's/;opcache.max_accelerated_files=10000/opcache.max_accelerated_files=50000/g' "$phpMainConf"
sed -i 's/;opcache.max_wasted_percentage=5/opcache.max_wasted_percentage=5/g' "$phpMainConf"
sed -i 's/;opcache.revalidate_freq=2/opcache.revalidate_freq=0/g' "$phpMainConf"
sed -i 's/; max_input_vars = 1000/max_input_vars = 10000/g' "$phpMainConf"
sed -i 's/upload_max_filesize = 2/upload_max_filesize = 128/g' "$phpMainConf"
sed -i 's/post_max_size = 8/post_max_size = 64/g' "$phpMainConf"
#Php session to disk
chown www-data:www-data /var/lib/php/sessions
chmod 1773 /var/lib/php/sessions
if [ "$shortdist" = "el8" ]; then
# Centos Mysql config
echo "pdo_mysql.default_socket = '/var/run/mysqld/mysqld.sock'" >> /etc/opt/remi/php${phpver//.}/php.d/60-mysql_sock.ini
echo "mysql.default_socket = '/var/run/mysqld/mysqld.sock'" >> /etc/opt/remi/php${phpver//.}/php.d/60-mysql_sock.ini
echo "mysqli.default_socket = '/var/run/mysqld/mysqld.sock'" >> /etc/opt/remi/php${phpver//.}/php.d/60-mysql_sock.ini
echo "d /run/php 0755 www-data www-data - -" > /usr/lib/tmpfiles.d/php-custom.conf
#Centos php Bin
sudo ln -s /usr/bin/php${phpver//.} /usr/bin/php
#Centos SeLinux
setsebool -P httpd_can_network_connect 1
fi
systemctl start $phpFPMService
systemctl enable $phpFPMService