Centos7源码安装php-7遇到的问题

下载安装包

wget http://cn.php.net/distributions/php-7.2.8.tar.xz

安装所需要的依赖包

yum -y install libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2-devel libcurl libcurl-devel libicu-devel libjpeg libjpeg-devel libpng libpng-devel openldap-devel  pcre-devel freetype freetype-devel gmp gmp-devel libmcrypt libmcrypt-devel readline readline-devel libxslt libxslt-devel mhash mhash-devel php72-php-mysqlnd

编译安装

tar xf php-7.2.8.tar.xz

cd php-7.2.8

 ./configure --prefix=/usr/local/php7  \
--with-config-file-path=/etc \
--enable-fpm \
--enable-inline-optimization \
--disable-debug \
--disable-rpath \
--enable-shared \
--enable-soap \
--with-openssl \
--enable-bcmath \
--with-iconv \
--with-bz2 \
--enable-calendar \
--with-curl \
--enable-exif  \
--enable-ftp \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-zlib-dir \
--with-freetype-dir \
--with-gettext \
--enable-json \
--enable-mbstring \
--enable-pdo \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-readline \
--enable-shmop \
--enable-simplexml \
--enable-sockets \
--enable-zip \
--enable-mysqlnd-compression-support \
--with-pear \
--enable-pcntl \
--enable-posix

编译报错

configure: error: Please reinstall the libzip distribution

解决方法:


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

重新编译报错:

configure: error: off_t undefined; check your library configuration

解决方法:

添加搜索路径到配置文件


echo '/usr/local/lib64

/usr/local/lib

/usr/lib

/usr/lib64'>>/etc/ld.so.conf

更新配置

ldconfig -v

重新编译,编译成功 ,执行安装

make && make install

安装报错:

/usr/local/include/zip.h:59:21:致命错误:zipconf.h:没有那个文件或目录

解决方法:手动复制过去

cp /usr/local/lib/libzip/include/zipconf.h /usr/local/include/zipconf.h

重新执行安装命令,安装成功

本文原出处:https://www.jianshu.com/p/644b8cae7a34

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值