我是用的環(huán)境是虛擬機,centos7 芽卿,cmake3.17.3
1.卸載舊版libzip:
yum -y remove libzip
2.安裝新版libzip:
cd /usr/local/src #1.切換到壓縮包下載目錄
wget https://libzip.org/download/libzip-1.5.2.tar.gz #2.下載壓縮包
tar -zxvf libzip-1.5.2.tar.gz #3.解壓壓縮包
cd libzip-1.5.2 #4.切換到解壓目錄
mkdir build #5.創(chuàng)建build文件夾
cd build #6.切換到build文件夾
cmake .. #7.cmake編譯缩功,注意存在兩個.
make #8.編譯
make install #9.安裝
3.配置新版 lib:
vi /etc/ld.so.conf
#添加如下配置:
/usr/local/lib64
/usr/local/lib
/usr/lib
/usr/lib64
#更新配置:
ldconfig -v
4.下載PHP壓縮包:
https://www.php.net/downloads.php
5.使用ftp遠程工具上傳到/usr/local/src目錄下
6.解壓:
tar -zxvf php-7.3.19.tar.gz
7.切換到解壓目錄:
cd php-7.3.19
7.編譯:
./configure \
--prefix=/usr/local/php\
--enable-fpm\
--with-fpm-user=www\
--with-fpm-group=www\
--with-config-file-path=/usr/local/php/conf\
--disable-rpath\
--enable-soap\
--with-libxml-dir\
--with-xmlrpc\
--with-openssl\
--with-mhash\
--with-pcre-regex\
--with-zlib\
--enable-bcmath\
--with-bz2\
--enable-calendar\
--with-curl\
--enable-exif\
--with-pcre-dir\
--enable-ftp\
--with-gd\
--with-openssl-dir\
--with-jpeg-dir\
--with-png-dir\
--with-zlib-dir\
--with-freetype-dir\
--enable-gd-jis-conv\
--with-gettext\
--with-gmp\
--with-mhash\
--enable-mbstring\
--with-onig\
--with-mysqli=mysqlnd\
--with-pdo-mysql=mysqlnd\
--with-zlib-dir\
--with-readline\
--enable-shmop\
--enable-sockets\
--enable-sysvmsg\
--enable-sysvsem \
--enable-sysvshm \
--enable-wddx\
--with-libxml-dir\
--with-xsl\
--enable-zip\
--with-pear
8.安裝:
make
make install
9.復(fù)制配置文件:
cd /usr/local/php
mkdir conf
cp /usr/local/src/php-7.3.19/php.ini-production /usr/local/php/conf/php.ini
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
cp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf
10.配置環(huán)境變量:
vi /etc/profile
下面添加:
php=/usr/local/php/bin
PATH=$PATH:$php
export PATH
11.刷新:
source /etc/profile
12.執(zhí)行phpinfo():
<?php
phpinfo();
?>