Centos 安装 php 5.6
来源:互联网 发布:手机淘宝订单怎么删除 编辑:程序博客网 时间:2024/06/07 02:20
首先将centos中的自带的老版本卸载,使用rpm -qa
查看现在系统中所有的php包
[root@iZ2ze2kxnw0qrut38zen9aZ ~]# rpm -qa | grep phpphp55w-gd-5.5.38-1.w7.x86_64php55w-devel-5.5.38-1.w7.x86_64php55w-mcrypt-5.5.38-1.w7.x86_64php55w-mbstring-5.5.38-1.w7.x86_64php55w-common-5.5.38-1.w7.x86_64php55w-fpm-5.5.38-1.w7.x86_64php55w-mysql-5.5.38-1.w7.x86_64php55w-cli-5.5.38-1.w7.x86_64php55w-5.5.38-1.w7.x86_64php55w-pdo-5.5.38-1.w7.x86_64
然后使用rpm -e
命令进行卸载
rpm -e php55w-gd-5.5.38-1.w7.x86_64
因为有些包有依赖关系,所以卸载的顺序可按照提示现行卸载
[root@iZ2ze2kxnw0qrut38zen9aZ ~]# rpm -e php55w-common-5.5.38-1.w7.x86_64错误:依赖检测失败: php55w-common(x86-64) = 5.5.38-1.w7 被 (已安裝) php55w-cli-5.5.38-1.w7.x86_64 需要 php55w-common(x86-64) = 5.5.38-1.w7 被 (已安裝) php55w-5.5.38-1.w7.x86_64 需要 php55w-common(x86-64) = 5.5.38-1.w7 被 (已安裝) php55w-fpm-5.5.38-1.w7.x86_64 需要 php55w-common(x86-64) = 5.5.38-1.w7 被 (已安裝) php55w-pdo-5.5.38-1.w7.x86_64 需要[root@iZ2ze2kxnw0qrut38zen9aZ ~]# rpm -e php55w-pdo-5.5.38-1.w7.x86_64错误:依赖检测失败: php55w-pdo(x86-64) 被 (已安裝) php55w-mysql-5.5.38-1.w7.x86_64 需要
也就是说pdo倒数第二个卸载,common最后一个卸载就可以
然后再次使用rpm -qa
查看是否还有php安装包
在卸载common后系统会将老版本的配置文件备份(话说还是很人性化呢!)
[root@iZ2ze2kxnw0qrut38zen9aZ ~]# rpm -e php55w-common-5.5.38-1.w7.x86_64警告:/etc/php.ini 已另存为 /etc/php.ini.rpmsave
然后添加rpm源(使用lsb_release -a
可以查看版本)
Centos 5.Xrpm -Uvh http://mirror.webtatic.com/yum/el5/latest.rpm
CentOs 6.xrpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
CentOs 7.Xrpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
最后执行yum install php56w.x86_64 php56w-cli.x86_64 php56w-common.x86_64 php56w-gd.x86_64 php56w-ldap.x86_64 php56w-mbstring.x86_64 php56w-mcrypt.x86_64 php56w-mysql.x86_64 php56w-pdo.x86_64
就可以了
安装php-fpmyum install php56w-fpm
php -v
查看版本拉
php5.5版本使用yum install php55w.x86_64 php55w-cli.x86_64 php55w-common.x86_64 php55w-gd.x86_64 php55w-ldap.x86_64 php55w-mbstring.x86_64 php55w-mcrypt.x86_64 php55w-mysql.x86_64 php55w-pdo.x86_64
php7.0版本使用yum install php70w.x86_64 php70w-cli.x86_64 php70w-common.x86_64 php70w-gd.x86_64 php70w-ldap.x86_64 php70w-mbstring.x86_64 php70w-mcrypt.x86_64 php70w-mysql.x86_64 php70w-pdo.x86_64
fpm
yum install php55w-fpm
yum install php70w-fpm
感谢参考:
- http://blog.csdn.net/ysydao/article/details/51388397
- http://blog.csdn.net/ityang_/article/details/53980190
- http://blog.csdn.net/dc_726/article/details/9519293
ps:以上文章有重复的部分,我只是把我用的拿出来了
- Centos 安装 php 5.6
- CentOS 6.5下PHP 5.6编译安装
- CentOS yum 安装 PHP 5.6.8
- CentOS 6.5 安装php 5.6方法
- CentOS 7 编译安装PHP 5.6
- centOS 自动安装php
- CentOS 安装PHP-PEAR
- CentOS源码安装PHP
- CentOS 安装 PHP
- CentOS下安装php
- CentOS 源码安装PHP
- Centos 安装PHP
- Centos PHP 安装
- centos源码安装PHP
- centos下安装php
- centos下php安装
- php 安装ImageMagick centos
- Centos下安装php
- Rewrite 重写配置
- 分布式一致性算法--Paxos
- nginx实现不停机更新
- Vue-router路由2.0的使用
- mac 安装配置 mnmp
- Centos 安装 php 5.6
- 【2016~2017】年总
- CMake 入门实战
- 关于Javascript 中 instanceof 与 typeof
- mysql中关于Every derived table must have its own alias问题
- 【DIY】使用竹签制作一个埃菲尔塔
- tomcat访问根目录下静态文件
- 微习惯--简单到四个
- WOJ1036-Cards