mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 18:27:13 +08:00
feat: update scripts
This commit is contained in:
80
scripts/php_extensions/exif.sh
Normal file
80
scripts/php_extensions/exif.sh
Normal file
@@ -0,0 +1,80 @@
|
||||
#!/bin/bash
|
||||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
|
||||
|
||||
: '
|
||||
Copyright 2022 HaoZi Technology Co., Ltd.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
'
|
||||
|
||||
HR="+----------------------------------------------------"
|
||||
|
||||
action="$1" # 操作
|
||||
phpVersion="$2" # PHP版本
|
||||
|
||||
Install() {
|
||||
# 检查是否已经安装
|
||||
isInstall=$(cat /www/server/php/${phpVersion}/etc/php.ini | grep '^extension=exif$')
|
||||
if [ "${isInstall}" != "" ]; then
|
||||
echo -e $HR
|
||||
echo "PHP-${phpVersion} 已安装 exif"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd /www/server/php/${phpVersion}/src/ext/exif
|
||||
/www/server/php/${phpVersion}/bin/phpize
|
||||
./configure --with-php-config=/www/server/php/${phpVersion}/bin/php-config
|
||||
make
|
||||
if [ "$?" != "0" ]; then
|
||||
echo -e $HR
|
||||
echo "PHP-${phpVersion} exif 编译失败"
|
||||
exit 1
|
||||
fi
|
||||
make install
|
||||
if [ "$?" != "0" ]; then
|
||||
echo -e $HR
|
||||
echo "PHP-${phpVersion} exif 安装失败"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sed -i '/;haozi/a\extension=exif' /www/server/php/${phpVersion}/etc/php.ini
|
||||
|
||||
# 重载PHP
|
||||
systemctl reload php-fpm-${phpVersion}.service
|
||||
echo -e $HR
|
||||
echo "PHP-${phpVersion} exif 安装成功"
|
||||
}
|
||||
|
||||
Uninstall() {
|
||||
# 检查是否已经安装
|
||||
isInstall=$(cat /www/server/php/${phpVersion}/etc/php.ini | grep '^extension=exif$')
|
||||
if [ "${isInstall}" == "" ]; then
|
||||
echo -e $HR
|
||||
echo "PHP-${phpVersion} 未安装 exif"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sed -i '/extension=exif/d' /www/server/php/${phpVersion}/etc/php.ini
|
||||
|
||||
# 重载PHP
|
||||
systemctl reload php-fpm-${phpVersion}.service
|
||||
echo -e $HR
|
||||
echo "PHP-${phpVersion} exif 卸载成功"
|
||||
}
|
||||
|
||||
if [ "$action" == 'install' ]; then
|
||||
Install
|
||||
fi
|
||||
if [ "$action" == 'uninstall' ]; then
|
||||
Uninstall
|
||||
fi
|
||||
91
scripts/php_extensions/imagemagick.sh
Normal file
91
scripts/php_extensions/imagemagick.sh
Normal file
@@ -0,0 +1,91 @@
|
||||
#!/bin/bash
|
||||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
|
||||
|
||||
: '
|
||||
Copyright 2022 HaoZi Technology Co., Ltd.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
'
|
||||
|
||||
HR="+----------------------------------------------------"
|
||||
|
||||
downloadUrl="https://dl.cdn.haozi.net/panel/php_extensions"
|
||||
action="$1"
|
||||
phpVersion="$2"
|
||||
imagickVersion="3.7.0"
|
||||
|
||||
Install() {
|
||||
# 检查是否已经安装
|
||||
isInstall=$(cat /www/server/php/${phpVersion}/etc/php.ini | grep '^extension=imagick$')
|
||||
if [ "${isInstall}" != "" ]; then
|
||||
echo -e $HR
|
||||
echo "PHP-${phpVersion} 已安装 imagick"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 安装依赖
|
||||
dnf install ImageMagick ImageMagick-devel -y
|
||||
|
||||
cd /www/server/php/${phpVersion}/src/ext
|
||||
rm -rf imagick
|
||||
rm -rf imagick.tar.gz
|
||||
wget -O imagick.tar.gz ${downloadUrl}/imagick-${imagickVersion}.tar.gz
|
||||
tar -zxvf imagick.tar.gz
|
||||
mv imagick-${imagickVersion} imagick
|
||||
cd imagick
|
||||
/www/server/php/${phpVersion}/bin/phpize
|
||||
./configure --with-php-config=/www/server/php/${phpVersion}/bin/php-config
|
||||
make
|
||||
if [ "$?" != "0" ]; then
|
||||
echo -e $HR
|
||||
echo "PHP-${phpVersion} imagick 编译失败"
|
||||
exit 1
|
||||
fi
|
||||
make install
|
||||
if [ "$?" != "0" ]; then
|
||||
echo -e $HR
|
||||
echo "PHP-${phpVersion} imagick 安装失败"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sed -i '/;haozi/a\extension=imagick' /www/server/php/${phpVersion}/etc/php.ini
|
||||
|
||||
# 重载PHP
|
||||
systemctl reload php-fpm-${phpVersion}.service
|
||||
echo -e $HR
|
||||
echo "PHP-${phpVersion} imagick 安装成功"
|
||||
}
|
||||
|
||||
Uninstall() {
|
||||
# 检查是否已经安装
|
||||
isInstall=$(cat /www/server/php/${phpVersion}/etc/php.ini | grep '^extension=imagick$')
|
||||
if [ "${isInstall}" == "" ]; then
|
||||
echo -e $HR
|
||||
echo "PHP-${phpVersion} 未安装 imagick"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sed -i '/extension=imagick/d' /www/server/php/${phpVersion}/etc/php.ini
|
||||
|
||||
# 重载PHP
|
||||
systemctl reload php-fpm-${phpVersion}.service
|
||||
echo -e $HR
|
||||
echo "PHP-${phpVersion} imagick 卸载成功"
|
||||
}
|
||||
|
||||
if [ "$action" == 'install' ]; then
|
||||
Install
|
||||
fi
|
||||
if [ "$action" == 'uninstall' ]; then
|
||||
Uninstall
|
||||
fi
|
||||
73
scripts/php_extensions/ioncube.sh
Normal file
73
scripts/php_extensions/ioncube.sh
Normal file
@@ -0,0 +1,73 @@
|
||||
#!/bin/bash
|
||||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
|
||||
|
||||
: '
|
||||
Copyright 2022 HaoZi Technology Co., Ltd.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
'
|
||||
|
||||
HR="+----------------------------------------------------"
|
||||
|
||||
downloadUrl="https://dl.cdn.haozi.net/panel/php_extensions"
|
||||
action="$1"
|
||||
phpVersion="$2"
|
||||
|
||||
Install() {
|
||||
# 检查是否已经安装
|
||||
isInstall=$(cat /www/server/php/${phpVersion}/etc/php.ini | grep 'ioncube_loader_lin')
|
||||
if [ "${isInstall}" != "" ]; then
|
||||
echo -e $HR
|
||||
echo "PHP-${phpVersion} 已安装 ionCube"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir /usr/local/ioncube
|
||||
wget -O /usr/local/ioncube/ioncube_loader_lin_${phpVersion}.so ${downloadUrl}/ioncube_loader_lin_${phpVersion}.so
|
||||
if [ "$?" != "0" ]; then
|
||||
echo -e $HR
|
||||
echo "错误:ionCube 下载失败,请检查网络是否正常。"
|
||||
exit 1
|
||||
fi
|
||||
sed -i -e "/;haozi/a\zend_extension=/usr/local/ioncube/ioncube_loader_lin_${phpVersion}.so" /www/server/php/${phpVersion}/etc/php.ini
|
||||
|
||||
# 重载PHP
|
||||
systemctl reload php-fpm-${phpVersion}.service
|
||||
echo -e $HR
|
||||
echo "PHP-${phpVersion} ionCube 安装成功"
|
||||
}
|
||||
|
||||
Uninstall() {
|
||||
# 检查是否已经安装
|
||||
isInstall=$(cat /www/server/php/${phpVersion}/etc/php.ini | grep 'ioncube_loader_lin')
|
||||
if [ "${isInstall}" == "" ]; then
|
||||
echo -e $HR
|
||||
echo "PHP-${phpVersion} 未安装 ionCube"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -f /usr/local/ioncube/ioncube_loader_lin_${phpVersion}.so
|
||||
sed -i '/ioncube_loader_lin/d' /www/server/php/${phpVersion}/etc/php.ini
|
||||
|
||||
# 重载PHP
|
||||
systemctl reload php-fpm-${phpVersion}.service
|
||||
echo -e $HR
|
||||
echo "PHP-${phpVersion} ionCube 卸载成功"
|
||||
}
|
||||
|
||||
if [ "$action" == 'install' ]; then
|
||||
Install
|
||||
fi
|
||||
if [ "$action" == 'uninstall' ]; then
|
||||
Uninstall
|
||||
fi
|
||||
68
scripts/php_extensions/opcache.sh
Normal file
68
scripts/php_extensions/opcache.sh
Normal file
@@ -0,0 +1,68 @@
|
||||
#!/bin/bash
|
||||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
|
||||
|
||||
: '
|
||||
Copyright 2022 HaoZi Technology Co., Ltd.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
'
|
||||
|
||||
HR="+----------------------------------------------------"
|
||||
|
||||
action="$1" # 操作
|
||||
phpVersion="$2" # PHP版本
|
||||
|
||||
Install() {
|
||||
# 检查是否已经安装
|
||||
isInstall=$(cat /www/server/php/${phpVersion}/etc/php.ini | grep '^zend_extension=opcache$')
|
||||
if [ "${isInstall}" != "" ]; then
|
||||
echo -e $HR
|
||||
echo "PHP-${phpVersion} 已安装 Zend OPcache"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "${phpVersion}" -ge "80" ]; then
|
||||
sed -i '/;haozi/a\zend_extension=opcache\nopcache.enable = 1\nopcache.enable_cli=1\nopcache.memory_consumption=128\nopcache.interned_strings_buffer=32\nopcache.max_accelerated_files=100000\nopcache.revalidate_freq=3\nopcache.save_comments=0\nopcache.jit_buffer_size=128m\nopcache.jit=1205' /www/server/php/${phpVersion}/etc/php.ini
|
||||
else
|
||||
sed -i '/;haozi/a\zend_extension=opcache\nopcache.enable = 1\nopcache.enable_cli=1\nopcache.memory_consumption=128\nopcache.interned_strings_buffer=32\nopcache.max_accelerated_files=100000\nopcache.revalidate_freq=3\nopcache.save_comments=0' /www/server/php/${phpVersion}/etc/php.ini
|
||||
fi
|
||||
# 重载PHP
|
||||
systemctl reload php-fpm-${phpVersion}.service
|
||||
echo -e $HR
|
||||
echo "PHP-${phpVersion} Zend OPcache 安装成功"
|
||||
}
|
||||
|
||||
Uninstall() {
|
||||
# 检查是否已经安装
|
||||
isInstall=$(cat /www/server/php/${phpVersion}/etc/php.ini | grep '^zend_extension=opcache$')
|
||||
if [ "${isInstall}" == "" ]; then
|
||||
echo -e $HR
|
||||
echo "PHP-${phpVersion} 未安装 Zend OPcache"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sed -i '/^opcache.*$/d' /www/server/php/${phpVersion}/etc/php.ini
|
||||
sed -i '/zend_extension=opcache/d' /www/server/php/${phpVersion}/etc/php.ini
|
||||
|
||||
# 重载PHP
|
||||
systemctl reload php-fpm-${phpVersion}.service
|
||||
echo -e $HR
|
||||
echo "PHP-${phpVersion} Zend OPcache 卸载成功"
|
||||
}
|
||||
|
||||
if [ "$action" == 'install' ]; then
|
||||
Install
|
||||
fi
|
||||
if [ "$action" == 'uninstall' ]; then
|
||||
Uninstall
|
||||
fi
|
||||
80
scripts/php_extensions/pdo_pgsql.sh
Normal file
80
scripts/php_extensions/pdo_pgsql.sh
Normal file
@@ -0,0 +1,80 @@
|
||||
#!/bin/bash
|
||||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
|
||||
|
||||
: '
|
||||
Copyright 2022 HaoZi Technology Co., Ltd.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
'
|
||||
|
||||
HR="+----------------------------------------------------"
|
||||
|
||||
action="$1"
|
||||
phpVersion="$2"
|
||||
|
||||
Install() {
|
||||
# 检查是否已经安装
|
||||
isInstall=$(cat /www/server/php/${phpVersion}/etc/php.ini | grep '^extension=pdo_pgsql$')
|
||||
if [ "${isInstall}" != "" ]; then
|
||||
echo -e $HR
|
||||
echo "PHP-${phpVersion} 已安装 pdo_pgsql"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd /www/server/php/${phpVersion}/src/ext/pdo_pgsql
|
||||
/www/server/php/${phpVersion}/bin/phpize
|
||||
./configure --with-php-config=/www/server/php/${phpVersion}/bin/php-config --with-pdo-pgsql=/usr/pgsql-15
|
||||
make
|
||||
if [ "$?" != "0" ]; then
|
||||
echo -e $HR
|
||||
echo "PHP-${phpVersion} pdo_pgsql 编译失败"
|
||||
exit 1
|
||||
fi
|
||||
make install
|
||||
if [ "$?" != "0" ]; then
|
||||
echo -e $HR
|
||||
echo "PHP-${phpVersion} pdo_pgsql 安装失败"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sed -i '/;haozi/a\extension=pdo_pgsql' /www/server/php/${phpVersion}/etc/php.ini
|
||||
|
||||
# 重载PHP
|
||||
systemctl reload php-fpm-${phpVersion}.service
|
||||
echo -e $HR
|
||||
echo "PHP-${phpVersion} pdo_pgsql 安装成功"
|
||||
}
|
||||
|
||||
Uninstall() {
|
||||
# 检查是否已经安装
|
||||
isInstall=$(cat /www/server/php/${phpVersion}/etc/php.ini | grep '^extension=pdo_pgsql$')
|
||||
if [ "${isInstall}" == "" ]; then
|
||||
echo -e $HR
|
||||
echo "PHP-${phpVersion} 未安装 pdo_pgsql"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sed -i '/extension=pdo_pgsql/d' /www/server/php/${phpVersion}/etc/php.ini
|
||||
|
||||
# 重载PHP
|
||||
systemctl reload php-fpm-${phpVersion}.service
|
||||
echo -e $HR
|
||||
echo "PHP-${phpVersion} pdo_pgsql 卸载成功"
|
||||
}
|
||||
|
||||
if [ "$action" == 'install' ]; then
|
||||
Install
|
||||
fi
|
||||
if [ "$action" == 'uninstall' ]; then
|
||||
Uninstall
|
||||
fi
|
||||
88
scripts/php_extensions/redis.sh
Normal file
88
scripts/php_extensions/redis.sh
Normal file
@@ -0,0 +1,88 @@
|
||||
#!/bin/bash
|
||||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
|
||||
|
||||
: '
|
||||
Copyright 2022 HaoZi Technology Co., Ltd.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
'
|
||||
|
||||
HR="+----------------------------------------------------"
|
||||
|
||||
downloadUrl="https://dl.cdn.haozi.net/panel/php_extensions"
|
||||
action="$1"
|
||||
phpVersion="$2"
|
||||
phpredisVersion="5.3.7"
|
||||
|
||||
Install() {
|
||||
# 检查是否已经安装
|
||||
isInstall=$(cat /www/server/php/${phpVersion}/etc/php.ini | grep '^extension=redis$')
|
||||
if [ "${isInstall}" != "" ]; then
|
||||
echo -e $HR
|
||||
echo "PHP-${phpVersion} 已安装 redis"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd /www/server/php/${phpVersion}/src/ext
|
||||
rm -rf phpredis
|
||||
rm -rf phpredis.tar.gz
|
||||
wget -O phpredis.tar.gz ${downloadUrl}/php-ext/phpredis-${phpredisVersion}.tar.gz
|
||||
tar -zxvf phpredis.tar.gz
|
||||
mv phpredis-${phpredisVersion} phpredis
|
||||
cd phpredis
|
||||
/www/server/php/${phpVersion}/bin/phpize
|
||||
./configure --with-php-config=/www/server/php/${phpVersion}/bin/php-config
|
||||
make
|
||||
if [ "$?" != "0" ]; then
|
||||
echo -e $HR
|
||||
echo "PHP-${phpVersion} redis 编译失败"
|
||||
exit 1
|
||||
fi
|
||||
make install
|
||||
if [ "$?" != "0" ]; then
|
||||
echo -e $HR
|
||||
echo "PHP-${phpVersion} redis 安装失败"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sed -i '/;haozi/a\extension=redis' /www/server/php/${phpVersion}/etc/php.ini
|
||||
|
||||
# 重载PHP
|
||||
systemctl reload php-fpm-${phpVersion}.service
|
||||
echo -e $HR
|
||||
echo "PHP-${phpVersion} redis 安装成功"
|
||||
}
|
||||
|
||||
Uninstall() {
|
||||
# 检查是否已经安装
|
||||
isInstall=$(cat /www/server/php/${phpVersion}/etc/php.ini | grep '^extension=redis$')
|
||||
if [ "${isInstall}" == "" ]; then
|
||||
echo -e $HR
|
||||
echo "PHP-${phpVersion} 未安装 redis"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sed -i '/extension=redis/d' /www/server/php/${phpVersion}/etc/php.ini
|
||||
|
||||
# 重载PHP
|
||||
systemctl reload php-fpm-${phpVersion}.service
|
||||
echo -e $HR
|
||||
echo "PHP-${phpVersion} redis 卸载成功"
|
||||
}
|
||||
|
||||
if [ "$action" == 'install' ]; then
|
||||
Install
|
||||
fi
|
||||
if [ "$action" == 'uninstall' ]; then
|
||||
Uninstall
|
||||
fi
|
||||
Reference in New Issue
Block a user