作者:破背包 | 来源:互联网 | 2022-11-27 11:42
php7比旧版本的性能提高了好多倍,linux通过yum安装php7。
![](https://img.php1.cn/3cd4a/21f45/711/8b87c62ce75a49c4.png)
首先我们先检查一下我们之前的php版本,通过yum list installed | grep php,如果没有输出信息说明是没有安装php
![](https://img.php1.cn/3cd4a/21f45/711/2caaaea87207b995.png)
如果有安装php,首先卸载之前的php版本,通过命令yum remove php*,卸载php所有的依赖
![](https://img.php1.cn/3cd4a/21f45/711/de4b4e96404452d1.png)
过yum list |grep php 查看一下php版本,发现现在是5.4的版本。
![](https://img.php1.cn/3cd4a/21f45/711/49e441353c129558.png)
现在php5.4,如果我们单独安装需要解决一些依赖问题,通过yum来解决依赖问题,通过命令我们引入云源
![](https://img.php1.cn/3cd4a/21f45/711/8042d3a25740944d.png)
![](https://img.php1.cn/3cd4a/21f45/711/b8d3577d8d80f6bb.png)
通过命令查看该源对应的安装包
![](https://img.php1.cn/3cd4a/21f45/711/4aa21c9732c5bf23.png)
执行安装php7.0,下载编译安装,如果网络慢的话,需要等一会
![](https://img.php1.cn/3cd4a/21f45/711/4a7dd34337a16944.png)
执行安装完毕以后查看一下php版本
![](https://img.php1.cn/3cd4a/21f45/711/8428074fc99d851c.png)