php 二进制安装

CentOS系统中编译安装PHP7.3及其依赖库
该博客详细记录了在CentOS系统上手动编译安装PHP7.3的过程,包括安装必要的依赖库如libxml2、openssl、curl等,以及zlib、libzip和cmake。在安装过程中,提到了如何配置和使用这些库,并最终成功编译和安装PHP7.3。

yum -y install libxml2 libxml2-devel openssl openssl-devel curl-devel

yum -y install libjpeg libpng freetype libjpeg-devel libpng-devel freetype-devel -y

yum -y install libevent libevent-devel

yum -y install gmp-devel

yum -y install readline-devel

yum -y install libxslt libxslt-devel

yum -y install gcc-c++ gcc

yum -y install bzip2 bzip2-devel

wget https://cmake.org/files/v3.19/cmake-3.19.1-Linux-x86_64.tar.gz

tar zxvf cmake-3.10.3.tar.gz

./bootstrap

gmake -j4

make install

1 下载php 7.3.8 tar.gz 包

tar zxvf php-7.3.8.tar.gz

groupadd www

useradd www

安装cmake

安装zlib

libzip 依赖

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-pkjrYNJG-1608546585247)(%E5%AE%89%E8%A3%85php%20%E8%AE%B0%E5%BD%95%E6%96%87%E6%A1%A3.assets/image-20201125162646316.png)]

缺少 zlib 包

cd /root/install

wget http://www.zlib.net/zlib-1.2.11.tar.gz

tar zxvf zlib-1.2.11.tar.gz

cd /root/install/zlib-1.2.11

./configure
make
make install

安装libzip

cd /root/install

wget https://libzip.org/download/libzip-1.5.2.tar.gz

cd /root/install/libzip-1.5.2

mkdir build && cd build && cmake …

vim /etc/ld.so.conf #添加如下几行

/usr/local/lib64

/usr/local/lib

/usr/lib

/usr/lib64

:wq #保存退出

ldconfig -v # 使之生效

安装php

wget https://www.php.net/distributions/php-7.3.19.tar.gz

cd /root/install/php-7.3.19

./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

make

make install

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值