Laravel要求php大于5.5.9,升级php5.3.3到5.6.14(最新版为 5.6.15 )
Add EPEL and Remi repositories onto your system:
wget
wget
rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
enable your newly added Remi repo . Open the /etc/yum.repos.d/remi.repo
在想要升级的版本里,enabled=0 line to enabled=1:
Update to PHP 5.4, in [remi] section:
Update to PHP 5.5, in [remi-php55] section:
Now update yum:
yum update -y //这个会升级很多额报错:
Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
编辑/etc/yum.repos.d/epel.repo,把基础的恢复,镜像的地址注释掉
编辑[epel]下的baseurl前的#号去掉,mirrorlist前添加#号
再次运行
yum update -y最后检查
php -v
PHP 5.6.24 (cli) (built: Jul 21 2016 07:42:08)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
====================以前的资料=============================
结果:
Removed:
php.x86_64 0:5.3.3-46.el6_6 php-cli.x86_64 0:5.3.3-46.el6_6 php-common.x86_64 0:5.3.3-46.el6_6 php-devel.x86_64 0:5.3.3-46.el6_6
php-fpm.x86_64 0:5.3.3-46.el6_6 php-gd.x86_64 0:5.3.3-46.el6_6 php-mbstring.x86_64 0:5.3.3-46.el6_6 php-mysql.x86_64 0:5.3.3-46.el6_6
php-pdo.x86_64 0:5.3.3-46.el6_6 php-xml.x86_64 0:5.3.3-46.el6_6
Installed:
php56w.x86_64 0:5.6.14-2.w6 php56w-cli.x86_64 0:5.6.14-2.w6 php56w-common.x86_64 0:5.6.14-2.w6 php56w-devel.x86_64 0:5.6.14-2.w6
php56w-fpm.x86_64 0:5.6.14-2.w6 php56w-gd.x86_64 0:5.6.14-2.w6 php56w-mbstring.x86_64 0:5.6.14-2.w6 php56w-mysql.x86_64 0:5.6.14-2.w6
php56w-pdo.x86_64 0:5.6.14-2.w6 php56w-xml.x86_64 0:5.6.14-2.w6
php -v
PHP 5.6.14 (cli) (built: Oct 16 2015 08:41:09)
安装
1,
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
2,
yum install yum-plugin-replace
yum replace php-common --replace-with=php56w-common
It will likely give you a message “WARNING: Unable to resolve all providers …”. This is normal, and you can continue by tying “y“.
Done!