centos7 自带的 php 5.4.16升级为 5.6.31
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
卸载遗漏的
yum list installed | grep php
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