How to update PHP5.3 to PHP5.6 in CentOS 6.5(Final)

How to update PHP5.3 to PHP5.6 in CentOS 6.5(Final)

加载 rpm 源

》rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm

安装前,需要先卸载 php-common。否则,出现冲突提醒:

yum remove php-common # Need to remove this, otherwise it conflicts

使用 yum install 安装 php56w,即 php 5.6 :

yum install php56w

安装完成 php56w 就会有如下提示

php --version               # Verify version has been upgraded
You can alternatively use php54w or php55w if required.

使用 yum install php56-mysql

》yum install php56w-mysql

使用 yum install php56-common

》yum install php56w-common

使用 yum install php56w-pdo

》yum install php56w-pdo

使用 yum install php56-opcache

》yum install php56w-opcache

删除安装 php5.6,回退到 php5.3

CAUTION!
This may potentially break your website if it doesn't fully resolve all your dependencies, 
so you may need a couple of extra packages in some cases. 
See here for a list of other PHP 5.6 modules that are available.
If you encounter a problem and need to reset back to the default, you can use these commands:
sudo yum remove php56w
sudo yum remove php56w-common
sudo yum install php-common
sudo yum install php-mysql
sudo yum install php

执行 composer install,遇到下面的问题

 Problem 1
    - Installation request for laravel/framework v5.4.0 -> satisfiable by laravel/framework[v5.4.0]
    - laravel/framework v5.4.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
  Problem 2
    - Installation request for league/html-to-markdown 4.4.0 -> satisfiable by league/html-to-mark down[4.4.0].
    - league/html-to-markdown 4.4.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.
  Problem 3
    - Installation request for phpunit/phpunit 5.7.6 -> satisfiable by phpunit/phpunit[5.7.6].
    - phpunit/phpunit 5.7.6 requires ext-dom * -> the requested PHP extension dom is missing from  your system.
  Problem 4
    - laravel/framework v5.4.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/tinker v1.0.0 requires illuminate/console ~5.1 -> satisfiable by laravel/framework[v5.4.0].
    - Installation request for laravel/tinker v1.0.0 -> satisfiable by laravel/tinker[v1.0.0].

解决方案:

yum install php56w-mbstring
yum install php56w-dom
安装对应版本的依赖即可。
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容