【原】PHP7.3.*版本安装(CentOS 7)
in with 0 comment

【原】PHP7.3.*版本安装(CentOS 7)

in with 0 comment

随着PHP版本的升级,相关的依赖库版本也跟着需要最新,所以原先的Yum已经不能满足我们的需求啦,这里就详细介绍下PHP7.3如何安装

Yum安装各必要组件

yum -y install make pcre-devel cmake gcc gcc-c++ flex bison libaio file libtool libtool-libs autoconf kernel-devel patch wget libxml2 libxml2-devel zlib zlib-devel glib2 glib2-devel unzip tar bzip2 bzip2-devel libevent libevent-devel ncurses ncurses-devel curl libjpeg libjpeg-devel libpng libpng-devel curl-devel e2fsprogs e2fsprogs-devel krb5-devel libidn libidn-devel openssl openssl-devel vim-minimal gettext gettext-devel ncurses-devel gmp-devel aspell-devel libcap diffutils net-tools libc-client-devel psmisc libXpm-devel git-core c-ares-devel libicu-devel freetype-devel libxslt libxslt-devel

安装新版本的Cmake【我选择的是Cmake3.16.6】

Cmake的下载地址:https://cmake.org/files/v3.16/cmake-3.16.6.tar.gz

./configure
make
make install

安装新版本的libzip【我安装的是最新版本1.7.3】

libzip的下载地址:https://libzip.org/download/libzip-1.7.3.tar.gz

cd libzip-1.7.3
mkdir build
cd build
cmake ..
make && make install

添加64位库

#添加搜索路径到配置文件

echo '/usr/local/lib64
/usr/local/lib
/usr/lib
/usr/lib64'>>/etc/ld.so.conf

#然后 更新配置

ldconfig -v

编译安装PHP7.3

./configure --enable-fpm --with-fpm-user=www --with-fpm-group=www --enable-mysqlnd --with-gd --enable-gd-native-ttf --with-freetype-dir --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv-dir --with-jpeg-dir --with-png-dir --with-zlib --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --enable-intl --enable-ftp --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --with-gettext --disable-fileinfo --enable-opcache --with-xsl --prefix=/opt/php --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --enable-gd-jis-conv
make
make install

* 如果你的机器内存足够大,请设置--enable-fileinfo【本文默认关闭此选项】
* 安装完记得将php.ini移动到指定目录
* 安装完记得修改php-fpm的配置文件
* 安装完记得启动php-fpm

判断是否编译完成

需要注意的

Comments are closed.