This commit is contained in:
condor
2026-07-24 18:54:53 +08:00
parent 43c2a411b9
commit 679e0b4184
128 changed files with 13855 additions and 1 deletions
+70
View File
@@ -0,0 +1,70 @@
#!/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_ZendGuardLoader() {
if [ -e "${php_install_dir}/bin/phpize" ]; then
pushd ${oneinstack_dir}/src > /dev/null
PHP_detail_ver=$(${php_install_dir}/bin/php-config --version)
PHP_main_ver=${PHP_detail_ver%.*}
phpExtensionDir=`${php_install_dir}/bin/php-config --extension-dir`
[ ! -d "${phpExtensionDir}" ] && mkdir -p ${phpExtensionDir}
if [ -n "`echo $phpExtensionDir | grep 'non-zts'`" ] && [ "${armplatform}" != 'y' ]; then
case "${PHP_main_ver}" in
5.6)
tar xzf zend-loader-php5.6-linux-x86_64.tar.gz
/bin/mv zend-loader-php5.6-linux-x86_64/ZendGuardLoader.so ${phpExtensionDir}
rm -rf zend-loader-php5.6-linux-x86_64
;;
5.5)
tar xzf zend-loader-php5.5-linux-x86_64.tar.gz
/bin/mv zend-loader-php5.5-linux-x86_64/ZendGuardLoader.so ${phpExtensionDir}
rm -rf zend-loader-php5.5-linux-x86_64
;;
5.4)
tar xzf ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64.tar.gz
/bin/mv ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64/php-5.4.x/ZendGuardLoader.so ${phpExtensionDir}
rm -rf ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64
;;
5.3)
tar xzf ZendGuardLoader-php-5.3-linux-glibc23-x86_64.tar.gz
/bin/mv ZendGuardLoader-php-5.3-linux-glibc23-x86_64/php-5.3.x/ZendGuardLoader.so ${phpExtensionDir}
rm -rf ZendGuardLoader-php-5.3-linux-glibc23-x86_64
;;
*)
echo "${CWARNING}Your php ${PHP_detail_ver} does not support ZendGuardLoader! ${CEND}";
;;
esac
if [ -f "${phpExtensionDir}/ZendGuardLoader.so" ]; then
chmod 644 ${phpExtensionDir}/ZendGuardLoader.so
cat > ${php_install_dir}/etc/php.d/01-ZendGuardLoader.ini<< EOF
[Zend Guard Loader]
zend_extension=${phpExtensionDir}/ZendGuardLoader.so
zend_loader.enable=1
zend_loader.disable_licensing=0
zend_loader.obfuscation_level_support=3
EOF
echo "${CSUCCESS}PHP ZendGuardLoader module installed successfully! ${CEND}"
fi
else
echo "Error! Your Apache's prefork or PHP already enable thread safety or platform ${TARGET_ARCH} does not support ZendGuardLoader! "
fi
popd > /dev/null
fi
}
Uninstall_ZendGuardLoader() {
if [ -e "${php_install_dir}/etc/php.d/01-ZendGuardLoader.ini" ]; then
rm -f ${php_install_dir}/etc/php.d/01-ZendGuardLoader.ini
echo; echo "${CMSG}PHP ZendGuardLoader module uninstall completed${CEND}"
else
echo; echo "${CWARNING}PHP ZendGuardLoader module does not exist! ${CEND}"
fi
}
+52
View File
@@ -0,0 +1,52 @@
#!/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_APCU() {
if [ -e "${php_install_dir}/bin/phpize" ]; then
pushd ${oneinstack_dir}/src > /dev/null
phpExtensionDir=`${php_install_dir}/bin/php-config --extension-dir`
if [ "`${php_install_dir}/bin/php-config --version | awk -F. '{print $1}'`" == '5' ]; then
tar xzf apcu-${apcu_oldver}.tgz
pushd apcu-${apcu_oldver} > /dev/null
else
tar xzf apcu-${apcu_ver}.tgz
pushd apcu-${apcu_ver} > /dev/null
fi
${php_install_dir}/bin/phpize
./configure --with-php-config=${php_install_dir}/bin/php-config
make -j ${THREAD} && make install
if [ -f "${phpExtensionDir}/apcu.so" ]; then
cat > ${php_install_dir}/etc/php.d/02-apcu.ini << EOF
[apcu]
extension=apcu.so
apc.enabled=1
apc.shm_size=32M
apc.ttl=7200
apc.enable_cli=1
EOF
/bin/cp apc.php ${wwwroot_dir}/default
popd > /dev/null
echo "${CSUCCESS}PHP apcu module installed successfully! ${CEND}"
rm -rf apcu-${apcu_ver} apcu-${apcu_oldver} package.xml
else
echo "${CFAILURE}PHP apcu module install failed, Please contact the author! ${CEND}" && lsb_release -a
fi
popd > /dev/null
fi
}
Uninstall_APCU() {
if [ -e "${php_install_dir}/etc/php.d/02-apcu.ini" ]; then
rm -rf ${php_install_dir}/etc/php.d/02-apcu.ini ${wwwroot_dir}/default/apc.php
echo; echo "${CMSG}PHP apcu module uninstall completed${CEND}"
else
echo; echo "${CWARNING}PHP apcu module does not exist! ${CEND}"
fi
}
+44
View File
@@ -0,0 +1,44 @@
#!/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_composer() {
if [ -e "${php_install_dir}/bin/phpize" ]; then
if [ -e "/usr/local/bin/composer" ]; then
echo "${CWARNING}PHP Composer already installed! ${CEND}"
else
pushd ${oneinstack_dir}/src > /dev/null
# get the IP information
PUBLIC_IPADDR=$(../lib/py/get_public_ipaddr.py)
IPADDR_COUNTRY=$(../lib/py/get_ipaddr_state.py ${PUBLIC_IPADDR})
if [ "${IPADDR_COUNTRY}"x == "CN"x ]; then
wget -c https://mirrors.aliyun.com/composer/composer.phar -O /usr/local/bin/composer > /dev/null 2>&1
${php_install_dir}/bin/php /usr/local/bin/composer config -g repo.packagist composer https://packagist.phpcomposer.com
else
wget -c https://getcomposer.org/composer.phar -O /usr/local/bin/composer > /dev/null 2>&1
fi
chmod +x /usr/local/bin/composer
if [ -e "/usr/local/bin/composer" ]; then
echo; echo "${CSUCCESS}PHP Composer installed successfully! ${CEND}"
else
echo; echo "${CFAILURE}PHP Composer install failed, Please try again! ${CEND}"
fi
popd > /dev/null
fi
fi
}
Uninstall_composer() {
if [ -e "/usr/local/bin/composer" ]; then
rm -f /usr/local/bin/composer
echo; echo "${CMSG}Composer uninstall completed${CEND}";
else
echo; echo "${CWARNING}Composer does not exist! ${CEND}"
fi
}
+73
View File
@@ -0,0 +1,73 @@
#!/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_eAccelerator() {
if [ -e "${php_install_dir}/bin/phpize" ]; then
pushd ${oneinstack_dir}/src > /dev/null
PHP_detail_ver=$(${php_install_dir}/bin/php-config --version)
PHP_main_ver=${PHP_detail_ver%.*}
phpExtensionDir=$(${php_install_dir}/bin/php-config --extension-dir)
if [[ "${PHP_main_ver}" =~ ^5.[3-4]$ ]]; then
if [ "${PHP_main_ver}" == '5.3' ]; then
tar jxf eaccelerator-${eaccelerator_ver}.tar.bz2
pushd eaccelerator-${eaccelerator_ver} > /dev/null
elif [ "${PHP_main_ver}" == '5.4' ]; then
/bin/mv master eaccelerator-eaccelerator-42067ac.tar.gz
tar xzf eaccelerator-eaccelerator-42067ac.tar.gz
pushd eaccelerator-eaccelerator-42067ac > /dev/null
fi
${php_install_dir}/bin/phpize
./configure --enable-eaccelerator=shared --with-php-config=${php_install_dir}/bin/php-config
make -j ${THREAD} && make install
popd > /dev/null
if [ -f "${phpExtensionDir}/eaccelerator.so" ]; then
mkdir /var/eaccelerator_cache;chown -R ${run_user}:${run_group} /var/eaccelerator_cache
cat > ${php_install_dir}/etc/php.d/02-eaccelerator.ini << EOF
[eaccelerator]
zend_extension=${phpExtensionDir}/eaccelerator.so
eaccelerator.shm_size=64
eaccelerator.cache_dir=/var/eaccelerator_cache
eaccelerator.enable=1
eaccelerator.optimizer=1
eaccelerator.check_mtime=1
eaccelerator.debug=0
eaccelerator.filter=
eaccelerator.shm_max=0
eaccelerator.shm_ttl=0
eaccelerator.shm_prune_period=0
eaccelerator.shm_only=0
eaccelerator.compress=0
eaccelerator.compress_level=9
eaccelerator.keys=disk_only
eaccelerator.sessions=disk_only
eaccelerator.content=disk_only
EOF
[ -z "$(grep 'kernel.shmmax = 67108864' /etc/sysctl.conf)" ] && echo "kernel.shmmax = 67108864" >> /etc/sysctl.conf
sysctl -p
echo "${CSUCCESS}PHP eaccelerator module installed successfully! ${CEND}"
rm -rf eaccelerator-${eaccelerator_ver} eaccelerator-eaccelerator-42067ac
else
echo "${CFAILURE}PHP eaccelerator module install failed, Please contact the author! ${CEND}" && lsb_release -a
fi
else
echo; echo "${CWARNING}Your php ${PHP_detail_ver} does not support eAccelerator! ${CEND}";
fi
popd > /dev/null
fi
}
Uninstall_eAccelerator() {
if [ -e "${php_install_dir}/etc/php.d/02-eaccelerator.ini" ]; then
rm -rf ${php_install_dir}/etc/php.d/02-eaccelerator.ini /var/eaccelerator_cache
echo; echo "${CMSG}PHP eaccelerator module uninstall completed${CEND}"
else
echo; echo "${CWARNING}PHP eaccelerator module does not exist! ${CEND}"
fi
}
+43
View File
@@ -0,0 +1,43 @@
#!/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_ionCube() {
if [ -e "${php_install_dir}/bin/phpize" ]; then
pushd ${oneinstack_dir}/src > /dev/null
PHP_detail_ver=`${php_install_dir}/bin/php-config --version`
PHP_main_ver=${PHP_detail_ver%.*}
phpExtensionDir=`${php_install_dir}/bin/php-config --extension-dir`
[ ! -d "${phpExtensionDir}" ] && mkdir -p ${phpExtensionDir}
[ -e "ioncube_loaders_lin_${SYS_ARCH_i}.tar.gz" ] && tar xzf ioncube_loaders_lin_${SYS_ARCH_i}.tar.gz
if [ -z "`echo ${phpExtensionDir} | grep 'non-zts'`" ]; then
/bin/mv ioncube/ioncube_loader_lin_${PHP_main_ver}_ts.so ${phpExtensionDir}
zend_extension="${phpExtensionDir}/ioncube_loader_lin_${PHP_main_ver}_ts.so"
else
/bin/mv ioncube/ioncube_loader_lin_${PHP_main_ver}.so ${phpExtensionDir}
zend_extension="${phpExtensionDir}/ioncube_loader_lin_${PHP_main_ver}.so"
fi
if [ -f "${zend_extension}" ]; then
echo "zend_extension=${zend_extension}" > ${php_install_dir}/etc/php.d/00-ioncube.ini
echo "${CSUCCESS}PHP ionCube module installed successfully! ${CEND}"
rm -rf ioncube
fi
popd > /dev/null
fi
}
Uninstall_ionCube() {
if [ -e "${php_install_dir}/etc/php.d/00-ioncube.ini" ]; then
rm -f ${php_install_dir}/etc/php.d/00-ioncube.ini
echo; echo "${CMSG}PHP ionCube module uninstall completed${CEND}"
else
echo; echo "${CWARNING}PHP ionCube module does not exist! ${CEND}"
fi
}
+41
View File
@@ -0,0 +1,41 @@
#!/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_pecl_calendar() {
if [ -e "${php_install_dir}/bin/phpize" ]; then
pushd ${oneinstack_dir}/src > /dev/null
phpExtensionDir=$(${php_install_dir}/bin/php-config --extension-dir)
PHP_detail_ver=$(${php_install_dir}/bin/php-config --version)
src_url=https://secure.php.net/distributions/php-${PHP_detail_ver}.tar.gz && Download_src
tar xzf php-${PHP_detail_ver}.tar.gz
pushd php-${PHP_detail_ver}/ext/calendar > /dev/null
${php_install_dir}/bin/phpize
./configure --with-php-config=${php_install_dir}/bin/php-config
make -j ${THREAD} && make install
popd > /dev/null
if [ -f "${phpExtensionDir}/calendar.so" ]; then
echo 'extension=calendar.so' > ${php_install_dir}/etc/php.d/04-calendar.ini
echo "${CSUCCESS}PHP calendar module installed successfully! ${CEND}"
rm -rf php-${PHP_detail_ver}
else
echo "${CFAILURE}PHP calendar module install failed, Please contact the author! ${CEND}" && lsb_release -a
fi
popd > /dev/null
fi
}
Uninstall_pecl_calendar() {
if [ -e "${php_install_dir}/etc/php.d/04-calendar.ini" ]; then
rm -f ${php_install_dir}/etc/php.d/04-calendar.ini
echo; echo "${CMSG}PHP calendar module uninstall completed${CEND}"
else
echo; echo "${CWARNING}PHP calendar module does not exist! ${CEND}"
fi
}
+42
View File
@@ -0,0 +1,42 @@
#!/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_pecl_fileinfo() {
if [ -e "${php_install_dir}/bin/phpize" ]; then
pushd ${oneinstack_dir}/src > /dev/null
phpExtensionDir=$(${php_install_dir}/bin/php-config --extension-dir)
PHP_detail_ver=$(${php_install_dir}/bin/php-config --version)
src_url=https://secure.php.net/distributions/php-${PHP_detail_ver}.tar.gz && Download_src
tar xzf php-${PHP_detail_ver}.tar.gz
pushd php-${PHP_detail_ver}/ext/fileinfo > /dev/null
${php_install_dir}/bin/phpize
./configure --with-php-config=${php_install_dir}/bin/php-config
[[ "${php_option}" =~ ^[23]$ ]] && sed -i 's@^CFLAGS = -g -O2@CFLAGS = -std=c99 -g -O2@' Makefile
make -j ${THREAD} && make install
popd > /dev/null
if [ -f "${phpExtensionDir}/fileinfo.so" ]; then
echo 'extension=fileinfo.so' > ${php_install_dir}/etc/php.d/04-fileinfo.ini
echo "${CSUCCESS}PHP fileinfo module installed successfully! ${CEND}"
rm -rf php-${PHP_detail_ver}
else
echo "${CFAILURE}PHP fileinfo module install failed, Please contact the author! ${CEND}" && lsb_release -a
fi
popd > /dev/null
fi
}
Uninstall_pecl_fileinfo() {
if [ -e "${php_install_dir}/etc/php.d/04-fileinfo.ini" ]; then
rm -f ${php_install_dir}/etc/php.d/04-fileinfo.ini
echo; echo "${CMSG}PHP fileinfo module uninstall completed${CEND}"
else
echo; echo "${CWARNING}PHP fileinfo module does not exist! ${CEND}"
fi
}
+47
View File
@@ -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_pecl_imap() {
if [ -e "${php_install_dir}/bin/phpize" ]; then
pushd ${oneinstack_dir}/src > /dev/null
if [ "${PM}" == 'yum' ]; then
yum -y install libc-client-devel
[ ! -e /usr/lib/libc-client.so ] && ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so
else
apt-get -y install libc-client2007e-dev
fi
phpExtensionDir=$(${php_install_dir}/bin/php-config --extension-dir)
PHP_detail_ver=$(${php_install_dir}/bin/php-config --version)
src_url=https://secure.php.net/distributions/php-${PHP_detail_ver}.tar.gz && Download_src
tar xzf php-${PHP_detail_ver}.tar.gz
pushd php-${PHP_detail_ver}/ext/imap > /dev/null
${php_install_dir}/bin/phpize
./configure --with-php-config=${php_install_dir}/bin/php-config --with-kerberos --with-imap --with-imap-ssl
make -j ${THREAD} && make install
popd > /dev/null
if [ -f "${phpExtensionDir}/imap.so" ]; then
echo 'extension=imap.so' > ${php_install_dir}/etc/php.d/04-imap.ini
echo "${CSUCCESS}PHP imap module installed successfully! ${CEND}"
rm -rf php-${PHP_detail_ver}
else
echo "${CFAILURE}PHP imap module install failed, Please contact the author! ${CEND}" && lsb_release -a
fi
popd > /dev/null
fi
}
Uninstall_pecl_imap() {
if [ -e "${php_install_dir}/etc/php.d/04-imap.ini" ]; then
rm -f ${php_install_dir}/etc/php.d/04-imap.ini
echo; echo "${CMSG}PHP imap module uninstall completed${CEND}"
else
echo; echo "${CWARNING}PHP imap module does not exist! ${CEND}"
fi
}
+48
View File
@@ -0,0 +1,48 @@
#!/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_pecl_ldap() {
if [ -e "${php_install_dir}/bin/phpize" ]; then
pushd ${oneinstack_dir}/src > /dev/null
phpExtensionDir=$(${php_install_dir}/bin/php-config --extension-dir)
PHP_detail_ver=$(${php_install_dir}/bin/php-config --version)
src_url=https://secure.php.net/distributions/php-${PHP_detail_ver}.tar.gz && Download_src
tar xzf php-${PHP_detail_ver}.tar.gz
pushd php-${PHP_detail_ver}/ext/ldap > /dev/null
if [ "${PM}" == 'yum' ]; then
yum -y install openldap-devel
else
apt-get -y install libldap2-dev
ln -s /usr/lib/${ARCH}-linux-gnu/libldap.so /usr/lib/
ln -s /usr/lib/${ARCH}-linux-gnu/liblber.so /usr/lib/
fi
${php_install_dir}/bin/phpize
./configure --with-php-config=${php_install_dir}/bin/php-config --with-ldap --with-libdir=lib64
make -j ${THREAD} && make install
popd > /dev/null
if [ -f "${phpExtensionDir}/ldap.so" ]; then
echo 'extension=ldap.so' > ${php_install_dir}/etc/php.d/04-ldap.ini
echo "${CSUCCESS}PHP ldap module installed successfully! ${CEND}"
rm -rf php-${PHP_detail_ver}
else
echo "${CFAILURE}PHP ldap module install failed, Please contact the author! ${CEND}" && lsb_release -a
fi
popd > /dev/null
fi
}
Uninstall_pecl_ldap() {
if [ -e "${php_install_dir}/etc/php.d/04-ldap.ini" ]; then
rm -f ${php_install_dir}/etc/php.d/04-ldap.ini
echo; echo "${CMSG}PHP ldap module uninstall completed${CEND}"
else
echo; echo "${CWARNING}PHP ldap module does not exist! ${CEND}"
fi
}
+69
View File
@@ -0,0 +1,69 @@
#!/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_pecl_mongodb() {
if [ -e "${php_install_dir}/bin/phpize" ]; then
pushd ${oneinstack_dir}/src > /dev/null
phpExtensionDir=$(${php_install_dir}/bin/php-config --extension-dir)
if [[ "$(${php_install_dir}/bin/php-config --version | awk -F. '{print $1$2}')" =~ ^5[3-4]$ ]]; then
src_url=https://pecl.php.net/get/mongo-${pecl_mongo_ver}.tgz && Download_src
tar xzf mongo-${pecl_mongo_ver}.tgz
pushd mongo-${pecl_mongo_ver} > /dev/null
${php_install_dir}/bin/phpize
./configure --with-php-config=${php_install_dir}/bin/php-config
make -j ${THREAD} && make install
popd > /dev/null
if [ -f "${phpExtensionDir}/mongo.so" ]; then
echo 'extension=mongo.so' > ${php_install_dir}/etc/php.d/07-mongo.ini
rm -rf mongo-${pecl_mongo_ver}
echo "${CSUCCESS}PHP mongo module installed successfully! ${CEND}"
else
echo "${CFAILURE}PHP mongo module install failed, Please contact the author! ${CEND}" && lsb_release -a
fi
else
if [[ "$(${php_install_dir}/bin/php-config --version | awk -F. '{print $1$2}')" =~ ^7[0-2]$ ]]; then
src_url=https://pecl.php.net/get/mongodb-${pecl_mongodb_oldver}.tgz && Download_src
tar xzf mongodb-${pecl_mongodb_oldver}.tgz
pushd mongodb-${pecl_mongodb_oldver} > /dev/null
else
src_url=https://pecl.php.net/get/mongodb-${pecl_mongodb_ver}.tgz && Download_src
tar xzf mongodb-${pecl_mongodb_ver}.tgz
pushd mongodb-${pecl_mongodb_ver} > /dev/null
fi
${php_install_dir}/bin/phpize
./configure --with-php-config=${php_install_dir}/bin/php-config
make -j ${THREAD} && make install
popd > /dev/null
if [ -f "${phpExtensionDir}/mongodb.so" ]; then
echo 'extension=mongodb.so' > ${php_install_dir}/etc/php.d/07-mongodb.ini
echo "${CSUCCESS}PHP mongodb module installed successfully! ${CEND}"
rm -rf mongodb-${pecl_mongodb_oldver} mongodb-${pecl_mongodb_ver}
else
echo "${CFAILURE}PHP mongodb module install failed, Please contact the author! ${CEND}" && lsb_release -a
fi
fi
popd > /dev/null
fi
}
Uninstall_pecl_mongodb() {
if [ -e "${php_install_dir}/etc/php.d/07-mongo.ini" ]; then
rm -f ${php_install_dir}/etc/php.d/07-mongo.ini
echo; echo "${CMSG}PHP mongo module uninstall completed${CEND}"
else
echo; echo "${CWARNING}PHP mongo module does not exist! ${CEND}"
fi
if [ -e "${php_install_dir}/etc/php.d/07-mongodb.ini" ]; then
rm -f ${php_install_dir}/etc/php.d/07-mongodb.ini
echo; echo "${CMSG}PHP mongodb module uninstall completed${CEND}"
else
echo; echo "${CWARNING}PHP mongodb module does not exist! ${CEND}"
fi
}
+46
View File
@@ -0,0 +1,46 @@
#!/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_pecl_pgsql() {
if [ -e "${php_install_dir}/bin/phpize" ]; then
pushd ${oneinstack_dir}/src > /dev/null
phpExtensionDir=`${php_install_dir}/bin/php-config --extension-dir`
PHP_detail_ver=$(${php_install_dir}/bin/php-config --version)
tar xzf php-${PHP_detail_ver}.tar.gz
pushd php-${PHP_detail_ver}/ext/pgsql > /dev/null
${php_install_dir}/bin/phpize
./configure --with-pgsql=${pgsql_install_dir} --with-php-config=${php_install_dir}/bin/php-config
make -j ${THREAD} && make install
popd > /dev/null
pushd php-${PHP_detail_ver}/ext/pdo_pgsql > /dev/null
${php_install_dir}/bin/phpize
./configure --with-pdo-pgsql=${pgsql_install_dir} --with-php-config=${php_install_dir}/bin/php-config
make -j ${THREAD} && make install
popd > /dev/null
if [ -f "${phpExtensionDir}/pgsql.so" -a -f "${phpExtensionDir}/pdo_pgsql.so" ]; then
echo 'extension=pgsql.so' > ${php_install_dir}/etc/php.d/07-pgsql.ini
echo 'extension=pdo_pgsql.so' >> ${php_install_dir}/etc/php.d/07-pgsql.ini
echo "${CSUCCESS}PHP pgsql module installed successfully! ${CEND}"
rm -rf php-${PHP_detail_ver}
else
echo "${CFAILURE}PHP pgsql module install failed, Please contact the author! ${CEND}" && lsb_release -a
fi
popd > /dev/null
fi
}
Uninstall_pecl_pgsql() {
if [ -e "${php_install_dir}/etc/php.d/07-pgsql.ini" ]; then
rm -f ${php_install_dir}/etc/php.d/07-pgsql.ini
echo; echo "${CMSG}PHP pgsql module uninstall completed${CEND}"
else
echo; echo "${CWARNING}PHP pgsql module does not exist! ${CEND}"
fi
}
+54
View File
@@ -0,0 +1,54 @@
#!/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_pecl_phalcon() {
if [ -e "${php_install_dir}/bin/phpize" ]; then
pushd ${oneinstack_dir}/src > /dev/null
PHP_detail_ver=$(${php_install_dir}/bin/php-config --version)
PHP_main_ver=${PHP_detail_ver%.*}
phpExtensionDir=$(${php_install_dir}/bin/php-config --extension-dir)
if [[ "${PHP_main_ver}" =~ ^7.[2-4]$|^8.0$ ]]; then
src_url=https://pecl.php.net/get/phalcon-${phalcon_ver}.tgz && Download_src
tar xzf phalcon-${phalcon_ver}.tgz
pushd phalcon-${phalcon_ver} > /dev/null
${php_install_dir}/bin/phpize
echo "${CMSG}It may take a few minutes... ${CEND}"
./configure --with-php-config=${php_install_dir}/bin/php-config
make -j ${THREAD} && make install
popd > /dev/null
elif [[ "${PHP_main_ver}" =~ ^5.[5-6]$|^7.[0-1]$ ]]; then
src_url=http://mirrors.linuxeye.com/oneinstack/src/cphalcon-${phalcon_oldver}.tar.gz && Download_src
tar xzf cphalcon-${phalcon_oldver}.tar.gz
pushd cphalcon-${phalcon_oldver}/build > /dev/null
echo "${CMSG}It may take a few minutes... ${CEND}"
./install --phpize ${php_install_dir}/bin/phpize --php-config ${php_install_dir}/bin/php-config --arch 64bits
popd > /dev/null
else
echo "${CWARNING}Your php ${PHP_detail_ver} does not support phalcon! ${CEND}"
fi
if [ -f "${phpExtensionDir}/phalcon.so" ]; then
echo 'extension=phalcon.so' > ${php_install_dir}/etc/php.d/04-phalcon.ini
echo "${CSUCCESS}PHP phalcon module installed successfully! ${CEND}"
rm -rf cphalcon-${phalcon_oldver} phalcon-${phalcon_ver}
else
echo "${CFAILURE}PHP phalcon module install failed, Please contact the author! ${CEND}" && lsb_release -a
fi
popd > /dev/null
fi
}
Uninstall_pecl_phalcon() {
if [ -e "${php_install_dir}/etc/php.d/04-phalcon.ini" ]; then
rm -f ${php_install_dir}/etc/php.d/04-phalcon.ini
echo; echo "${CMSG}PHP phalcon module uninstall completed${CEND}"
else
echo; echo "${CWARNING}PHP phalcon module does not exist! ${CEND}"
fi
}
+56
View File
@@ -0,0 +1,56 @@
#!/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_pecl_swoole() {
if [ -e "${php_install_dir}/bin/phpize" ]; then
pushd ${oneinstack_dir}/src > /dev/null
phpExtensionDir=$(${php_install_dir}/bin/php-config --extension-dir)
PHP_detail_ver=$(${php_install_dir}/bin/php-config --version)
PHP_main_ver=${PHP_detail_ver%.*}
if [[ "${PHP_main_ver}" =~ ^5.[3-6]$ ]]; then
src_url=https://pecl.php.net/get/swoole-1.10.5.tgz && Download_src
tar xzf swoole-1.10.5.tgz
pushd swoole-1.10.5 > /dev/null
${php_install_dir}/bin/phpize
./configure --with-php-config=${php_install_dir}/bin/php-config --enable-openssl --with-openssl-dir=${openssl_install_dir}
elif [[ "${PHP_main_ver}" =~ ^7.[0-1]$ ]]; then
src_url=https://pecl.php.net/get/swoole-${swoole_oldver}.tgz && Download_src
tar xzf swoole-${swoole_oldver}.tgz
pushd swoole-${swoole_oldver} > /dev/null
${php_install_dir}/bin/phpize
./configure --with-php-config=${php_install_dir}/bin/php-config --enable-openssl --with-openssl-dir=${openssl_install_dir}
else
src_url=https://pecl.php.net/get/swoole-${swoole_ver}.tgz && Download_src
tar xzf swoole-${swoole_ver}.tgz
pushd swoole-${swoole_ver} > /dev/null
${php_install_dir}/bin/phpize
./configure --with-php-config=${php_install_dir}/bin/php-config --enable-openssl --with-openssl-dir=${openssl_install_dir} --enable-http2 --enable-swoole-json --enable-swoole-curl
fi
make -j ${THREAD} && make install
popd > /dev/null
if [ -f "${phpExtensionDir}/swoole.so" ]; then
echo 'extension=swoole.so' > ${php_install_dir}/etc/php.d/06-swoole.ini
echo "${CSUCCESS}PHP swoole module installed successfully! ${CEND}"
rm -rf swoole-${swoole_ver} swoole-${swoole_oldver}
else
echo "${CFAILURE}PHP swoole module install failed, Please contact the author! ${CEND}" && lsb_release -a
fi
popd > /dev/null
fi
}
Uninstall_pecl_swoole() {
if [ -e "${php_install_dir}/etc/php.d/06-swoole.ini" ]; then
rm -f ${php_install_dir}/etc/php.d/06-swoole.ini
echo; echo "${CMSG}PHP swoole module uninstall completed${CEND}"
else
echo; echo "${CWARNING}PHP swoole module does not exist! ${CEND}"
fi
}
+68
View File
@@ -0,0 +1,68 @@
#!/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_pecl_xdebug() {
if [ -e "${php_install_dir}/bin/phpize" ]; then
pushd ${oneinstack_dir}/src > /dev/null
phpExtensionDir=$(${php_install_dir}/bin/php-config --extension-dir)
PHP_detail_ver=$(${php_install_dir}/bin/php-config --version)
PHP_main_ver=${PHP_detail_ver%.*}
if [[ "${PHP_main_ver}" =~ ^7.[0-4]$|^80$ ]]; then
if [[ "${PHP_main_ver}" =~ ^7.[0-1]$ ]]; then
src_url=https://pecl.php.net/get/xdebug-${xdebug_oldver}.tgz && Download_src
tar xzf xdebug-${xdebug_oldver}.tgz
pushd xdebug-${xdebug_oldver} > /dev/null
else
src_url=https://pecl.php.net/get/xdebug-${xdebug_ver}.tgz && Download_src
tar xzf xdebug-${xdebug_ver}.tgz
pushd xdebug-${xdebug_ver} > /dev/null
fi
${php_install_dir}/bin/phpize
./configure --with-php-config=${php_install_dir}/bin/php-config
make -j ${THREAD} && make install
popd > /dev/null
if [ -f "${phpExtensionDir}/xdebug.so" ]; then
src_url=http://mirrors.linuxeye.com/oneinstack/src/webgrind-master.zip && Download_src
unzip -q webgrind-master.zip
/bin/mv webgrind-master ${wwwroot_dir}/default/webgrind
[ ! -e /tmp/xdebug ] && { mkdir /tmp/xdebug; chown ${run_user}:${run_group} /tmp/xdebug; }
[ ! -e /tmp/webgrind ] && { mkdir /tmp/webgrind; chown ${run_user}:${run_group} /tmp/webgrind; }
chown -R ${run_user}:${run_group} ${wwwroot_dir}/default/webgrind
sed -i 's@static $storageDir.*@static $storageDir = "/tmp/webgrind";@' ${wwwroot_dir}/default/webgrind/config.php
sed -i 's@static $profilerDir.*@static $profilerDir = "/tmp/xdebug";@' ${wwwroot_dir}/default/webgrind/config.php
cat > ${php_install_dir}/etc/php.d/08-xdebug.ini << EOF
[xdebug]
zend_extension=xdebug.so
xdebug.trace_output_dir=/tmp/xdebug
xdebug.profiler_output_dir = /tmp/xdebug
xdebug.profiler_enable = On
xdebug.profiler_enable_trigger = 1
EOF
echo "${CSUCCESS}PHP xdebug module installed successfully! ${CEND}"
echo; echo "Webgrind URL: ${CMSG}http://{Public IP}/webgrind ${CEND}"
rm -rf xdebug-${xdebug_ver} xdebug-${xdebug_oldver}
else
echo "${CFAILURE}PHP xdebug module install failed, Please contact the author! ${CEND}" && lsb_release -a
fi
else
echo "${CWARNING}Your php ${PHP_detail_ver} does not support xdebug! ${CEND}";
fi
popd > /dev/null
fi
}
Uninstall_pecl_xdebug() {
if [ -e "${php_install_dir}/etc/php.d/08-xdebug.ini" ]; then
rm -rf ${php_install_dir}/etc/php.d/08-xdebug.ini /tmp/{xdebug,webgrind} ${wwwroot_dir}/default/webgrind
echo; echo "${CMSG}PHP xdebug module uninstall completed${CEND}"
else
echo; echo "${CWARNING}PHP xdebug module does not exist! ${CEND}"
fi
}
+46
View File
@@ -0,0 +1,46 @@
#!/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_pecl_yaf() {
if [ -e "${php_install_dir}/bin/phpize" ]; then
pushd ${oneinstack_dir}/src > /dev/null
PHP_detail_ver=$(${php_install_dir}/bin/php-config --version)
PHP_main_ver=${PHP_detail_ver%.*}
if [[ "${PHP_main_ver}" =~ ^7.[0-4]$|^8.0$ ]]; then
phpExtensionDir=$(${php_install_dir}/bin/php-config --extension-dir)
src_url=https://pecl.php.net/get/yaf-${yaf_ver}.tgz && Download_src
tar xzf yaf-${yaf_ver}.tgz
pushd yaf-${yaf_ver} > /dev/null
${php_install_dir}/bin/phpize
./configure --with-php-config=${php_install_dir}/bin/php-config
make -j ${THREAD} && make install
popd > /dev/null
if [ -f "${phpExtensionDir}/yaf.so" ]; then
echo 'extension=yaf.so' > ${php_install_dir}/etc/php.d/04-yaf.ini
echo "${CSUCCESS}PHP yaf module installed successfully! ${CEND}"
rm -rf yaf-${yaf_ver}
else
echo "${CFAILURE}PHP yaf module install failed, Please contact the author! ${CEND}" && lsb_release -a
fi
else
echo "${CWARNING}Your php ${PHP_detail_ver} does not support yaf! ${CEND}";
fi
popd > /dev/null
fi
}
Uninstall_pecl_yaf() {
if [ -e "${php_install_dir}/etc/php.d/04-yaf.ini" ]; then
rm -f ${php_install_dir}/etc/php.d/04-yaf.ini
echo; echo "${CMSG}PHP yaf module uninstall completed${CEND}"
else
echo; echo "${CWARNING}PHP yaf module does not exist! ${CEND}"
fi
}
+46
View File
@@ -0,0 +1,46 @@
#!/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_pecl_yar() {
if [ -e "${php_install_dir}/bin/phpize" ]; then
pushd ${oneinstack_dir}/src > /dev/null
PHP_detail_ver=$(${php_install_dir}/bin/php-config --version)
PHP_main_ver=${PHP_detail_ver%.*}
if [[ "${PHP_main_ver}" =~ ^7.[0-4]$|^8.0$ ]]; then
phpExtensionDir=$(${php_install_dir}/bin/php-config --extension-dir)
src_url=https://pecl.php.net/get/yar-${yar_ver}.tgz && Download_src
tar xzf yar-${yar_ver}.tgz
pushd yar-${yar_ver} > /dev/null
${php_install_dir}/bin/phpize
./configure --with-php-config=${php_install_dir}/bin/php-config --with-curl=${curl_install_dir}
make -j ${THREAD} && make install
popd > /dev/null
if [ -f "${phpExtensionDir}/yar.so" ]; then
echo 'extension=yar.so' > ${php_install_dir}/etc/php.d/04-yar.ini
echo "${CSUCCESS}PHP yar module installed successfully! ${CEND}"
rm -rf yar-${yar_ver}
else
echo "${CFAILURE}PHP yar module install failed, Please contact the author! ${CEND}" && lsb_release -a
fi
else
echo "${CWARNING}Your php ${PHP_detail_ver} does not support yar! ${CEND}";
fi
popd > /dev/null
fi
}
Uninstall_pecl_yar() {
if [ -e "${php_install_dir}/etc/php.d/04-yar.ini" ]; then
rm -f ${php_install_dir}/etc/php.d/04-yar.ini
echo; echo "${CMSG}PHP yar module uninstall completed${CEND}"
else
echo; echo "${CWARNING}PHP yar module does not exist! ${CEND}"
fi
}
+49
View File
@@ -0,0 +1,49 @@
#!/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_SourceGuardian() {
if [ -e "${php_install_dir}/bin/phpize" ]; then
pushd ${oneinstack_dir}/src > /dev/null
PHP_detail_ver=`${php_install_dir}/bin/php-config --version`
PHP_main_ver=${PHP_detail_ver%.*}
phpExtensionDir=`${php_install_dir}/bin/php-config --extension-dir`
[ ! -e sourceguardian ] && mkdir sourceguardian
[ -e "loaders.linux-${ARCH}.tar.gz" ] && tar xzf loaders.linux-${ARCH}.tar.gz -C sourceguardian
if [ -e "sourceguardian/ixed.${PHP_main_ver}.lin" ]; then
[ ! -d "${phpExtensionDir}" ] && mkdir -p ${phpExtensionDir}
if [ -z "`echo ${phpExtensionDir} | grep 'non-zts'`" ]; then
/bin/mv sourceguardian/ixed.${PHP_main_ver}ts.lin ${phpExtensionDir}
extension="ixed.${PHP_main_ver}ts.lin"
else
/bin/mv sourceguardian/ixed.${PHP_main_ver}.lin ${phpExtensionDir}
extension="ixed.${PHP_main_ver}.lin"
fi
if [ -f "${phpExtensionDir}/ixed.${PHP_main_ver}.lin" ]; then
echo "extension=${extension}" > ${php_install_dir}/etc/php.d/02-sourceguardian.ini
echo "${CSUCCESS}PHP SourceGuardian module installed successfully! ${CEND}"
rm -rf sourceguardian
fi
else
echo; echo "${CWARNING}Your php ${PHP_detail_ver} or platform ${TARGET_ARCH} does not support SourceGuardian! ${CEND}";
fi
popd > /dev/null
fi
}
Uninstall_SourceGuardian() {
if [ -e "${php_install_dir}/etc/php.d/02-sourceguardian.ini" ]; then
rm -f ${php_install_dir}/etc/php.d/02-sourceguardian.ini
echo; echo "${CMSG}PHP SourceGuardian module uninstall completed${CEND}"
else
echo; echo "${CWARNING}PHP SourceGuardian module does not exist! ${CEND}"
fi
}
+86
View File
@@ -0,0 +1,86 @@
#!/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_XCache() {
if [ -e "${php_install_dir}/bin/phpize" ]; then
pushd ${oneinstack_dir}/src > /dev/null
phpExtensionDir=$(${php_install_dir}/bin/php-config --extension-dir)
PHP_detail_ver=$(${php_install_dir}/bin/php-config --version)
PHP_main_ver=${PHP_detail_ver%.*}
if [[ "${PHP_main_ver}" =~ ^5.[3-6]$ ]]; then
tar xzf xcache-${xcache_ver}.tar.gz
pushd xcache-${xcache_ver} > /dev/null
${php_install_dir}/bin/phpize
./configure --enable-xcache --enable-xcache-coverager --enable-xcache-optimizer --with-php-config=${php_install_dir}/bin/php-config
make -j ${THREAD} && make install
if [ -f "${phpExtensionDir}/xcache.so" ]; then
/bin/cp -R htdocs ${wwwroot_dir}/default/xcache
popd > /dev/null
chown -R ${run_user}:${run_group} ${wwwroot_dir}/default/xcache
touch /tmp/xcache;chown ${run_user}:${run_group} /tmp/xcache
let xcacheCount="${CPU}+1"
let xcacheSize="${Memory_limit}/2"
cat > ${php_install_dir}/etc/php.d/04-xcache.ini << EOF
[xcache-common]
extension=xcache.so
[xcache.admin]
xcache.admin.enable_auth=On
xcache.admin.user=admin
xcache.admin.pass="${xcachepwd_md5}"
[xcache]
xcache.size=${xcacheSize}M
xcache.count=${xcacheCount}
xcache.slots=8K
xcache.ttl=3600
xcache.gc_interval=300
xcache.var_size=4M
xcache.var_count=${xcacheCount}
xcache.var_slots=8K
xcache.var_ttl=0
xcache.var_maxttl=0
xcache.var_gc_interval=300
xcache.test=Off
xcache.readonly_protection=Off
xcache.shm_scheme=mmap
xcache.mmap_path=/tmp/xcache
xcache.coredump_directory=
xcache.cacher=On
xcache.stat=On
xcache.optimizer=Off
[xcache.coverager]
; enabling this feature will impact performance
; enable only if xcache.coverager == On && xcache.coveragedump_directory == "non-empty-value"
; enable coverage data collecting and xcache_coverager_start/stop/get/clean() functions
xcache.coverager = Off
xcache.coverager_autostart = On
xcache.coveragedump_directory = ""
EOF
echo "${CSUCCESS}PHP xcache module installed successfully! ${CEND}"
rm -rf xcache-${xcache_ver}
else
echo "${CFAILURE}PHP xcache module install failed, Please contact the author! ${CEND}" && lsb_release -a
fi
else
echo; echo "${CWARNING}Your php ${PHP_detail_ver} does not support XCache! ${CEND}";
fi
popd > /dev/null
fi
}
Uninstall_XCache() {
if [ -e "${php_install_dir}/etc/php.d/04-xcache.ini" ]; then
rm -rf ${php_install_dir}/etc/php.d/04-xcache.ini ${wwwroot_dir}/default/xcache /tmp/xcache
echo; echo "${CMSG}PHP xcache module uninstall completed${CEND}"
else
echo; echo "${CWARNING}PHP xcache module does not exist! ${CEND}"
fi
}
+85
View File
@@ -0,0 +1,85 @@
#!/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_ZendOPcache() {
if [ -e "${php_install_dir}/bin/phpize" ]; then
pushd ${oneinstack_dir}/src > /dev/null
phpExtensionDir=$(${php_install_dir}/bin/php-config --extension-dir)
PHP_detail_ver=$(${php_install_dir}/bin/php-config --version)
PHP_main_ver=${PHP_detail_ver%.*}
if [[ "${PHP_main_ver}" =~ ^5.[3-4]$ ]]; then
tar xzf zendopcache-${zendopcache_ver}.tgz
pushd zendopcache-${zendopcache_ver} > /dev/null
else
src_url=https://secure.php.net/distributions/php-${PHP_detail_ver}.tar.gz && Download_src
tar xzf php-${PHP_detail_ver}.tar.gz
pushd php-${PHP_detail_ver}/ext/opcache > /dev/null
fi
${php_install_dir}/bin/phpize
./configure --with-php-config=${php_install_dir}/bin/php-config
make -j ${THREAD} && make install
popd > /dev/null
if [ -f "${phpExtensionDir}/opcache.so" ]; then
# write opcache configs
if [[ "${PHP_main_ver}" =~ ^5.[3-4]$ ]]; then
# For php 5.3 5.4
cat > ${php_install_dir}/etc/php.d/02-opcache.ini << EOF
[opcache]
zend_extension=${phpExtensionDir}/opcache.so
opcache.enable=1
opcache.memory_consumption=${Memory_limit}
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=60
;opcache.save_comments=0
opcache.fast_shutdown=1
opcache.enable_cli=1
;opcache.optimization_level=0
EOF
rm -rf zendopcache-${zendopcache_ver}
else
# For php 5.5+
cat > ${php_install_dir}/etc/php.d/02-opcache.ini << EOF
[opcache]
zend_extension=opcache.so
opcache.enable=1
opcache.enable_cli=1
opcache.memory_consumption=${Memory_limit}
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=100000
opcache.max_wasted_percentage=5
opcache.use_cwd=1
opcache.validate_timestamps=1
opcache.revalidate_freq=60
;opcache.save_comments=0
opcache.fast_shutdown=1
opcache.consistency_checks=0
;opcache.optimization_level=0
EOF
fi
echo "${CSUCCESS}PHP opcache module installed successfully! ${CEND}"
rm -rf php-${PHP_detail_ver}
else
echo "${CFAILURE}PHP opcache module install failed, Please contact the author! ${CEND}" && lsb_release -a
fi
popd > /dev/null
fi
}
Uninstall_ZendOPcache() {
if [ -e "${php_install_dir}/etc/php.d/02-opcache.ini" ]; then
rm -f ${php_install_dir}/etc/php.d/02-opcache.ini
echo; echo "${CMSG}PHP opcache module uninstall completed${CEND}"
else
echo; echo "${CWARNING}PHP opcache module does not exist! ${CEND}"
fi
}