现在windows中的软件随着需求量每时每刻都在更新,不更新再难满足用户需求。linux也是一样,落伍的软件版本已经不再试用,本篇文章主要针对linux环境下php和mysql的升级。
测试环境:
CENTOS6.8(腾讯云学生机) mysql 版本 5.1 php 版本5.3
一、更新php版本为5.6
1.查看并删除原有的php5.3(如果没有安装可以直接安装php5.6)
查看原本的php版本:
1  |  php -V  | 
查看已经安装的php的包:
1  |  yum list installed | grep php  | 
然后删除这些包:
1  | yum remove ... ...  | 
检查是否删除完毕:
1  | yum list installed | grep php  | 
结果为空则证明删除完毕
2.安装php5.6
添加源:
1 2  | rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm  | 
使用yum list命令查看可安装的包:
1  | yum list --enablerepo=remi --enablerepo=remi-php56 | grep php  | 
安装php5.6
1  | yum install ... ...  | 
省略号为上面显示的和php5.6有关的内容
比如我这里是:
1  | yum install php56w.i386 php56w-bcmath.i386 php56w-cli.i386 php56w-common.i386 php56w-dba.i386 php56w-devel.i386 php56w-embedded.i386 php56w-enchant.i386 php56w-fpm.i386 php56w-gd.i386 php56w-imap.i386 php56w-interbase.i386 php56w-intl.i386 php56w-ldap.i386 php56w-mbstring.i386 php56w-mcrypt.i386 php56w-mssql.i386 php56w-mysql.i386 hp56w-mysqlnd.i386 php56w-odbc.i386 php56w-opcache.i386 php56w-pdo.i386  | 
一定要把目录中的所有项都安装,否则会出现未知错误,只能卸了重新安装。
成功以后,我们可以查看现在的php版本:
1  |  php --version  | 
重启php-fpm:
1  | service php-fpm restart  | 
二、升级mysql到5.5
1.卸载原来的mysql5.1
查看是否安装了mysql:
1  | rpm -qa| grep mysql  | 
卸载mysql5.1:
1  | rpm -e mysql-libs --nodeps  | 
2.安装mysql5.5
添加源
1 2  | rpm -Uvh http://mirror.steadfast.net/epel/6/i386/epel-release-6-8.noarch.rpm rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm  | 
查看是否增加成功:
1  | yum --enablerepo=remi,remi-test list mysql mysql-server  | 
得到如下结构:
1 2 3 4 5 6 7 8  | Loading mirror speeds from cached hostfile * remi: mirrors.tuna.tsinghua.edu.cn * remi-safe: mirrors.tuna.tsinghua.edu.cn * remi-test: mirrors.tuna.tsinghua.edu.cn * webtatic: sp.repo.webtatic.com Installed Packages mysql.i686 5.5.54-1.el6.remi @remi mysql-server.i686 5.5.54-1.el6.remi @remi  | 
安装mysql5.5
1  | yum --enablerepo=remi,remi-test install mysql mysql-server  | 
到最后显示complete表示安装成功
启动mysql
1  | /etc/init.d/mysqld start  | 
支持mysql开机启动
1  | chkconfig --levels 345 mysqld on  | 
以后还可以安装phpmyadmin来管理mysql,详见:
		                            		                        			            	
		                            		                        			            	
		                            		                        			            	
                
                                                                
3 pings
[…] centos下升级mysql5.5+php5.6 […]
[…] centos下升级mysql5.5+php5.6 […]
[…] « centos下升级mysql5.5+php5.6 […]