centos 编译安装 php7.1.8

下载PHP文件

curl -o php-7.1.8.tar.gz https://www.php.net/distributions/php-7.1.8.tar.gz

解压

tar -zxvf php-7.1.8.tar.gz

进行 ./configure 之前,对php常用的依赖进行安装

yum -y install libxml2 libxml2-devel openssl openssl-devel curl-devel libjpeg-devel libpng-devel freetype-devel libmcrypt-devel libxslt libxslt-devel
yum install openssh-server vim net-tools iproute htop lsof iostat tcpdump git atop wget supervisor dstat unzip mysql redis memcached telnet nc -y && yum clean all
执行下面的参数

./configure --prefix=/usr/local/services/7.1.8 \
--with-config-file-path=/usr/local/etc/php/7.1.8 \
--with-config-file-scan-dir=/usr/local/etc/php/7.1.8/conf.d \
--with-openssl=/usr/local/opt/openssl \
--with-mysqli \
--with-pdo-mysql \
--with-iconv-dir \
--with-freetype-dir=/usr/local/freetype \
--with-zlib \
--with-jpeg-dir \
--with-png-dir \
--with-libxml-dir=/usr/bin/xml2-config \
--enable-xml \
--disable-rpath \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--with-curl \
--enable-mbregex \
--enable-mbstring \
--with-mcrypt \
--enable-ftp \
--with-gd \
--enable-gd-native-ttf \
--with-openssl \
--with-mhash \
--enable-pcntl \
--enable-sockets \
--with-xmlrpc \
--enable-zip \
--enable-soap \
--without-pear \
--enable-fpm \
--with-fpm-user=www \
--with-fpm-group=www \
--enable-maintainer-zts \
--enable-mysqlnd 

1 : openssl 1.0.1 version问题

无论是升级 openssl 还是加装 pkg-config 都无法解决

最终的解决方式

升级 openssl 后
ln -s /usr/local/services/openssl/1.0.2r/include/openssl /usr/local/include/openssl

安装

make -j 4 && make install

配置PHP到环境变量中

ln -s /usr/local/services/7.1.8/sbin/php-fpm /usr/local/sbin/php-fpm
ln -s /usr/local/services/7.1.8/bin/php /usr/local/bin/php

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值