File: //var/tmp0/brainy/ssh/php_fpm.sh
#!/bin/bash
source "/var/brainycp/data/server_control/main"
if [ "$back_server" == 'nginx' ]; then
echo "current apache version:"
echo $back_server
if [ "$php52w" == 'php5.2' ] || [ "$php53w" == 'php5.3' ] || [ "$php54w" == 'php5.4' ] || [ "$php55w" == 'php5.5' ] || [ "$php56w" == 'php5.6' ] || [ "$php70w" == 'php7.0' ] || [ "$php71w" == 'php7.1' ]; then
echo "current php versions:"
echo $php52w
echo $php53w
echo $php54w
echo $php55w
echo $php56w
echo $php70w
echo $php71w
read -p "enter the php version, which you want to enable in apache like fpm:" v
find /usr/lib64/httpd/modules -name "libphp*" | xargs rm
find "$apache_path"conf.d -name "cgi.conf" | xargs rm
find /var/www/php-cgi/main -name "php.cgi" | xargs rm
if [ "$v" == 'php5.2' ]; then
cp /etc/brainy/nginx_fpm.conf /etc/nginx/nginx.conf
/usr/bin/php53/etc/rc.d/init.d stop
/usr/bin/php54/etc/rc.d/init.d stop
/usr/bin/php55/etc/rc.d/init.d stop
/usr/bin/php56/etc/rc.d/init.d stop
/usr/bin/php70/etc/rc.d/init.d stop
/usr/bin/php71/etc/rc.d/init.d stop
/usr/bin/php52/etc/rc.d/init.d restart
service nginx restart
elif [ "$v" == 'php5.3' ]; then
cp /etc/brainy/nginx_fpm.conf /etc/nginx/nginx.conf
/usr/bin/php52/etc/rc.d/init.d stop
/usr/bin/php54/etc/rc.d/init.d stop
/usr/bin/php55/etc/rc.d/init.d stop
/usr/bin/php56/etc/rc.d/init.d stop
/usr/bin/php70/etc/rc.d/init.d stop
/usr/bin/php71/etc/rc.d/init.d stop
/usr/bin/php53/etc/rc.d/init.d restart
service nginx restart
elif [ "$v" == 'php5.4' ]; then
cp /etc/brainy/nginx_fpm.conf /etc/nginx/nginx.conf
/usr/bin/php53/etc/rc.d/init.d stop
/usr/bin/php52/etc/rc.d/init.d stop
/usr/bin/php55/etc/rc.d/init.d stop
/usr/bin/php56/etc/rc.d/init.d stop
/usr/bin/php70/etc/rc.d/init.d stop
/usr/bin/php71/etc/rc.d/init.d stop
/usr/bin/php54/etc/rc.d/init.d restart
service nginx restart
elif [ "$v" == 'php5.5' ]; then
cp /etc/brainy/nginx_fpm.conf /etc/nginx/nginx.conf
/usr/bin/php53/etc/rc.d/init.d stop
/usr/bin/php54/etc/rc.d/init.d stop
/usr/bin/php52/etc/rc.d/init.d stop
/usr/bin/php56/etc/rc.d/init.d stop
/usr/bin/php70/etc/rc.d/init.d stop
/usr/bin/php71/etc/rc.d/init.d stop
/usr/bin/php55/etc/rc.d/init.d restart
service nginx restart
elif [ "$v" == 'php5.6' ]; then
cp /etc/brainy/nginx_fpm.conf /etc/nginx/nginx.conf
/usr/bin/php53/etc/rc.d/init.d stop
/usr/bin/php54/etc/rc.d/init.d stop
/usr/bin/php55/etc/rc.d/init.d stop
/usr/bin/php52/etc/rc.d/init.d stop
/usr/bin/php70/etc/rc.d/init.d stop
/usr/bin/php71/etc/rc.d/init.d stop
/usr/bin/php56/etc/rc.d/init.d restart
service nginx restart
elif [ "$v" == 'php7.0' ]; then
cp /etc/brainy/nginx_fpm.conf /etc/nginx/nginx.conf
/usr/bin/php53/etc/rc.d/init.d stop
/usr/bin/php54/etc/rc.d/init.d stop
/usr/bin/php55/etc/rc.d/init.d stop
/usr/bin/php56/etc/rc.d/init.d stop
/usr/bin/php52/etc/rc.d/init.d stop
/usr/bin/php71/etc/rc.d/init.d stop
/usr/bin/php70/etc/rc.d/init.d restart
service nginx restart
elif [ "$v" == 'php7.1' ]; then
cp /etc/brainy/nginx_fpm.conf /etc/nginx/nginx.conf
/usr/bin/php53/etc/rc.d/init.d stop
/usr/bin/php54/etc/rc.d/init.d stop
/usr/bin/php55/etc/rc.d/init.d stop
/usr/bin/php56/etc/rc.d/init.d stop
/usr/bin/php52/etc/rc.d/init.d stop
/usr/bin/php70/etc/rc.d/init.d stop
/usr/bin/php71/etc/rc.d/init.d restart
service nginx restart
fi
fi
fi
exit 0