#1 下载源码
wget https://www.php.net/distributions/php-8.2.35.tar.gz
#2 解压缩
tar -zxvf php-8.2.35.tar.gz
#3 配置,编译,安装
cd php-8.2.35
/configure \
--prefix=/usr/local/php82 \
--with-fpm-user=nginx \
--with-fpm-group=nginx \
--enable-fpm \
--enable-mbstring \
--enable-opcache \
--with-curl \
--with-openssl=/usr/local/openssl11 \
--with-pdo-mysql \
--enable-gd \
--with-freetype \
--with-jpeg \
--with-bz2 \
--with-readline \
--enable-bcmath \
--with-zip \
--enable-fileinfo \
--with-sodium
#4 安装php8.2.35
make -j4 && make install
ln -s /usr/local/php82/bin/php /usr/bin/php
ln -s /usr/local/php82/sbin/php-fpm /usr/bin/php-fpm