init
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
#!/bin/bash
|
||||
# Author: yeho <lj2007331 AT gmail.com>
|
||||
# BLOG: https://linuxeye.com
|
||||
#
|
||||
# Notes: OneinStack for CentOS/RedHat 7+ Debian 9+ and Ubuntu 16+
|
||||
#
|
||||
# Project home page:
|
||||
# https://oneinstack.com
|
||||
# https://github.com/oneinstack/oneinstack
|
||||
|
||||
Install_MPHP() {
|
||||
if [ -e "${php_install_dir}/sbin/php-fpm" ]; then
|
||||
if [ -e "${php_install_dir}${mphp_ver}/bin/phpize" ]; then
|
||||
echo "${CWARNING}PHP${mphp_ver} already installed! ${CEND}"
|
||||
else
|
||||
[ -e "/lib/systemd/system/php-fpm.service" ] && /bin/mv /lib/systemd/system/php-fpm.service{,_bk}
|
||||
php_install_dir=${php_install_dir}${mphp_ver}
|
||||
case "${mphp_ver}" in
|
||||
74)
|
||||
. modules/php/php-7.4.sh
|
||||
Install_PHP74 2>&1 | tee -a ${oneinstack_dir}/runtime/install.log
|
||||
;;
|
||||
80)
|
||||
. modules/php/php-8.0.sh
|
||||
Install_PHP80 2>&1 | tee -a ${oneinstack_dir}/runtime/install.log
|
||||
;;
|
||||
81)
|
||||
. modules/php/php-8.1.sh
|
||||
Install_PHP81 2>&1 | tee -a ${oneinstack_dir}/runtime/install.log
|
||||
;;
|
||||
esac
|
||||
if [ -e "${php_install_dir}/sbin/php-fpm" ]; then
|
||||
systemctl stop php-fpm
|
||||
sed -i "s@/dev/shm/php-cgi.sock@/dev/shm/php${mphp_ver}-cgi.sock@" ${php_install_dir}/etc/php-fpm.conf
|
||||
[ -e "/lib/systemd/system/php-fpm.service" ] && /bin/mv /lib/systemd/system/php-fpm.service /lib/systemd/system/php${mphp_ver}-fpm.service
|
||||
[ -e "/lib/systemd/system/php-fpm.service_bk" ] && /bin/mv /lib/systemd/system/php-fpm.service{_bk,}
|
||||
systemctl enable php${mphp_ver}-fpm
|
||||
systemctl enable php-fpm
|
||||
systemctl start php-fpm
|
||||
systemctl start php${mphp_ver}-fpm
|
||||
sed -i "s@${php_install_dir}/bin:@@" /etc/profile
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo "${CWARNING}To use the multiple PHP versions, You need to use PHP-FPM! ${CEND}"
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user