php 安装 bzip2,编译安装php7.2

1、apt-get   install    libxml2  libxml2-dev    autoconf   gcc     bzip2   libzip-dev   libssl-dev   libcurl-dev

安装编译安装所需要的依赖

去官网下载php,放在/usr/local/src/

cd  /usr/local/src

tar   zxvf    php-7.2.16.tar.gz

cd php-7.2.16

编译安装一些必要的扩展

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-mysqlnd    --with-pdo-mysql=mysqlnd --with-gd --with-openssl  --with-iconv                --with-curl   --enable-mbstring   --enable-zip --enable-fpm  --with-pear --with-zlib

报错

configure: error: Cannot find OpenSSL's

安装libsll资源库

apt-get  install libssl-dev

报错

configure: error: Cannot find OpenSSL's libraries

出现这种有2中情况,一种是没有安装 openssl,另一种是安装了找不到libssl.so 文件。

先安装openssl

sudo apt-get install openssl

如果还提示该错误的话,查找一下libssl.so所在位置,重新连接一下

find / -name libssl.so

输出

/usr/lib/x86_64-linux-gnu/libssl.so

说明 libssl.so在这个位置

然后重新连接一下

ln -s /usr/lib/x86_64-linux-gnu/libssl.so  /usr/lib

安装报错

configure: error: Please reinstall the libcurl distribution - easy.h should be in /include/curl/

执行

sudo apt-get install libcurl-ocaml-dev

安装gd库报错

configure: error: png.h not found.

执行

apt-get  install libpng++-dev

apt-get install libjpeg-dev

报错

checking for libzip... configure: error: system libzip must be upgraded to version >= 0.11

apt-get  remove -y libzip

#下载编译安装

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

make: *** [sapi/cli/php] Error 1

解决:

在PHP源码目录下 vi Makefile 打开文件,找到 EXTRA_LIBS 行,在行末添加 -llber 保存退出再次make即可

重新执行上面的命令./configure

make

make install

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值