下载php7.3.1源码
wget http://php.net/distributions/php-7.3.1.tar.gz && tar -zxvf php-7.3.1.tar.gz && cd php-7.3.1
配置要安装的库
./buildconf --force
./configure \
--prefix=/usr/local/php \
--with-config-file-path=/usr/local/php/etc \
--with-config-file-scan-dir=/usr/local/php/conf.d \
--with-sqlite3 \
--with-pdo-sqlite \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--enable-posix \
--enable-pcntl \
--enable-shmop \
--enable-sysvshm \
--enable-sysvsem \
--enable-sysvmsg \
--enable-phar \
--enable-zip \
--with-zlib \
--with-zlib-dir \
--with-bz2 \
--with-gd \
--enable-gd-jis-conv \
--with-webp-dir \
--with-jpeg-dir \
--with-png-dir \
--with-xpm-dir \
--with-freetype-dir \
--enable-exif \
--enable-json \
--enable-libxml \
--with-libxml-dir \
--enable-xml \
--enable-xmlreader \
--enable-xmlwriter \
--enable-simplexml \
--with-pear \
--with-xsl \
--enable-dom \
--enable-soap \
--enable-wddx \
--with-xmlrpc \
--enable-ctype \
--enable-filter \
--with-pcre-regex \
--with-pcre-jit \
--with-enchant \
--with-pspell \
--enable-fileinfo \
--enable-mbstring \
--with-iconv \
--enable-hash \
--with-openssl \
--enable-bcmath \
--with-gmp \
--enable-session \
--enable-sockets \
--enable-ftp \
--with-curl \
--with-ldap \
--with-ldap-sasl \
--with-imap \
--with-kerberos \
--with-imap-ssl \
--enable-calendar \
--with-gettext \
--with-tidy \
--with-readline \
--enable-tokenizer \
--enable-opcache \
--enable-cli \
--enable-cgi \
--enable-fpm \
--enable-phpdbg
编译安装
make -j `grep processor /proc/cpuinfo | wc -l` && make install
编译报错
checking for libzip... configure: error: system libzip must be upgraded to version >= 0.11
yum remove libzip libzip-devel
wget https://nih.at/libzip/libzip-1.2.0.tar.gz
tar -zxvf libzip-1.2.0.tar.gz
cd libzip-1.2.0
./configure
make
make install
collect2: error: ld returned 1 exit status
vim Makefile 找到 开头是 'EXTRA_LIBS' 这一行 在结尾加上 '-llber'
如果还报错再加上'-liconv'
fatal error: zipconf.h: No such file or directory
//查找 zipconf.h
find / -name zipconf.h
// 复制 zipconf.h 到 /usr/local/include/
cp /usr/local/lib/libzip/include/zipconf.h /usr/local/include/