#!/bin/bash export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH source <(curl -f -s --connect-timeout 10 --retry 3 https://dl.acepanel.net/public.sh) if [ $? -ne 0 ]; then echo "Download public.sh failed, please check the network or try again later." exit 1 fi slug=${1} version=${2} php_path="${setup_path}/server/php/${slug}" j=$(calculate_j) # 预检查 systemctl is-active --quiet php-fpm-${slug} if [ "$?" != "0" ]; then error "Application is not running properly" fi # 准备安装目录 cd ${php_path} rm -rf src # 下载源码 dl "${php_path}" "/php/php-${version}.7z" 7z x php-${version}.7z rm -f php-${version}.7z mv php-* src # 配置 cd src chmod +x buildconf chmod +x configure chmod +x build/shtool chmod +x build/config-stubs chmod +x build/*.sh # PHP <= 80 openssl3 补丁 if [ ${slug} -le "80" ]; then dl "${php_path}/src" "/php/php-${slug}-openssl3.patch" patch -p1