安装php7.3.5笔记及出坑指南

今天安装了php7.3.5 记录一下安装笔记,及碰到的坑。

1.首先安装yum源:

yum install epel-release

2.安装环境包:

yum install unzip libxml2 libxml2-devel freetype freetype-devel libcurl libcurl-devel libjpeg libjpeg-devel libpng libpng-devel rsync openssl openssl-devel libmcrypt libmcrypt-devel autoconf libtool

3.安装cmake.(php7.3.5需要安装libzip,而libzip需要新版本的cmake)

cd ~ && yum remove cmake -y
wget https://github.com/Kitware/CMake/releases/download/v3.14.3/cmake-3.14.3.tar.gz
tar xvf cmake-3.14.3.tar.gz && cd cmake-3.14.3/
./bootstrap
gmake && gmake install
ln -s /usr/local/bin/cmake /usr/bin/
cmake --version

4.安装libzip

wget https://libzip.org/download/libzip-1.5.2.tar.gz
tar xvf libzip-1.5.2.tar.gz 
cd libzip-1.5.2 
mkdir build && cd build && cmake ..
make && make install

5.下载php7.3.5

在官网下载的话,速度贼慢。国内源也找不到了,貌似只有一个源了。最后去github上找到项目地址,下载release版本。秒下。

wget https://github.com/php/php-src/archive/php-7.3.5.tar.gz

6.安装php

先生成配置文件,新版本中不用autoconf了。方法如下:

./buildconf --force

安装开始:

./configure --prefix=/usr/local/php7.3 --with-curl=/usr/lib --with-mysqli --with-pdo-mysql --enable-fpm --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-gd --with-libxml-dir --enable-xml --disable-debug --enable-mbstring --enable-soap --enable-sockets --enable-zip --with-config-file-path=/usr/local/php7.3/etc --with-config-file-scan-dir=/usr/local/php7.3/etc/conf.d --with-libdir=lib64 --with-openssl

出现错误

checking for bison version... invalid
configure: WARNING: This bison version is not supported for regeneration of the Zend/PHP parsers (found: none, min: 204, excluded: ).
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
configure: error: bison is required to build PHP/Zend when building a GIT checkout!

解决方法:安装bison

yum install bison

安装完成后,返回上一步。顺利编译。

接着make

make && make install

至此,大功告成!

 

转载于:https://www.cnblogs.com/fengho/p/10836511.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值