码迷,mamicode.com
首页 > Web开发 > 详细

将centos 7 自带的 php 5.4升级为 5.6

时间:2017-10-13 20:05:59      阅读:1079      评论:0      收藏:0      [点我收藏+]

标签:-o   epel   tps   mcr   enable   .com   pre   lease   remove   

1、php -v 
PHP 5.4.16 (cli) (built: Nov 6 2016 00:29:02) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

  

2、执行下面的命令升级软件仓库 
rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm 
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

  

3、执行下面的命令删除php 
yum remove php-common 
然后像安装那样问你是否继续的,输入yes即可

yum list installed | grep php 
yum remove php56w.x86_64 
yum remove ....

  

4、安装php 5.6版本
yum install -y php56w php56w-opcache php56w-xml php56w-mcrypt php56w-gd php56w-devel php56w-mysql php56w-intl php56w-mbstring

  

5、安装PHP FPM
yum install php56w-fpm
systemctl enable php-fpm.service【开机自启动】
/bin/systemctl start php-fpm.service 【启动php-fpm】

  

6、查看版本
PHP 5.6.31 (cli) (built: Sep 14 2017 18:12:46) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

 

sed -i ‘s/^;date\.timezone\ =/date\.timezone\ =\ "Asia\/Shanghai"/‘ /etc/php.ini

sed -i ‘s/^user\ =\ apache/user\ =\ nginx/‘ /etc/php-fpm.d/www.conf
sed -i ‘s/^group\ =\ apache/group\ =\ nginx/‘ /etc/php-fpm.d/www.conf

 

/bin/systemctl restart php-fpm.service
/bin/systemctl restart nginx.service

  

将centos 7 自带的 php 5.4升级为 5.6

标签:-o   epel   tps   mcr   enable   .com   pre   lease   remove   

原文地址:http://www.cnblogs.com/lovekingly/p/7662673.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!