Linux安装php

一、下载

网址:http://cn2.php.net/get/php-7.1.6.tar.gz/from/a/mirror
我选择了一个香港近一点的服务器下载
这里写图片描述

下载之后是一个tar.gz文件,ftp上传到你的linux服务器。

二、解压

tar -xvf php-7.1.6.tar.gz
cd php-7.1.6

执行编译的时候报了如下错误:

[root@localhost php-7.1.6]# ./configure 
Configuring extensions
checking size of long... (cached) 8
checking size of int... (cached) 4
checking for int32_t... yes
checking for uint32_t... yes
checking for sys/types.h... (cached) yes
checking for inttypes.h... (cached) yes
checking for stdint.h... (cached) yes
checking for string.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for strtoll... yes
checking for atoll... yes
checking for strftime... (cached) yes
checking for gettimeofday... (cached) yes
checking whether to enable LIBXML support... yes
checking libxml2 install dir... no
checking for xml2-config path... 
configure: error: xml2-config not found. Please check your libxml2 installation.

执行如下命令

yum install libxml2

yum install libxml2-devel -y

再次执行./configure成功生成makefile

然后执行:

[root@localhost php-7.1.6]# make & make install

在make的时候遇到了如下错误:

libtool: link: `ext/opcache/ZendAccelerator.lo' is not a valid libtool object

执行如下:

make distclean

重新生成makefile,再执行make命令,发现编译成功了,执行make install完成php的安装。

[root@localhost php-7.1.6]# php -v
PHP 7.1.6 (cli) (built: Sep  4 2018 11:31:08) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

黄宝康

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值