bwre 环境安装:

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)" speed
brew install oniguruma pkg-config gettext libiconv bzip2 openssl curl freetype jpeg gd libzip libsodium

下载php

php_version=8.3.15
wget https://www.php.net/distributions/php-$php_version.tar.gz
tar -zxvf php-$php_version.tar.gz

#!/bin/bash
# 获取额外参数
if [ -z "$1" ]; then
  echo "请输入需要编译的版本号:"
  read php_version
fi

php_version=$1

# wget https://www.php.net/distributions/php-$php_version.tar.gz
# tar -zxvf php-$php_version.tar.gz

cd php-$php_version*

ROOT_PATH=/Applications/EServer
php_path=$ROOT_PATH/childApp/php/php-$php_version
./configure --prefix=$php_path \
--with-config-file-path=$php_path/etc \
--with-config-file-scan-dir=$php_path/etc/conf.d \
--disable-rpath \
--enable-shared \
--enable-opcache \
--enable-fpm \
--with-sodium \
--with-mysqli \
--with-pdo-mysql \
--with-gettext=$(brew --prefix gettext) \
--enable-mbstring \
--with-iconv=$(brew --prefix libiconv) \
--with-bz2=$(brew --prefix bzip2) \
--with-openssl \
--enable-bcmath \
--enable-soap \
--enable-pcntl \
--enable-shmop \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-sockets \
--with-curl \
--with-zlib \
--enable-gd \
--with-freetype=$(brew --prefix freetype) \
--with-jpeg=$(brew --prefix jpeg)

make -j $(sysctl -n hw.ncpu) 
make install &

# cp php.ini-development /Applications/EServer/software/php/php-$php_version/etc/php.ini