13 July 2015

当webmin把php从5.16升级到5.2.7后...

分类:Linux VPS教程 by 阿川

当webmin把php从5.16升级到5.2.7后,肯定是出现了一堆问题的..不然也不会有这篇文章出来鸟.
首先.升级php
vi /etc/yum.repos.d/utterrambling.repo
如果你的vps或主机是32bit的Centos请输入以下内容:

    [utterramblings]
    name=Jason,s Utter Ramblings Repo
    baseurl=http://www.jasonlitka.com/media/EL5/i386/
    enabled=1
    gpgcheck=1
    gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka

如果你的主机或者vps是64bit的Centos系统请输入下面的内容:

    [utterramblings]
    name=Jason,s Utter Ramblings Repo
    baseurl=http://www.jasonlitka.com/media/EL5/x86_64/
    enabled=1
    gpgcheck=1
    gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka

之后关闭fastestmirror,

vim /etc/yum/pluginconf.d/fastestmirror.conf

把enable 改为0
安装之前最好卸载掉php,之后执行升级

yum remove php*
yum -y upgrade php

很显然.这样升级.肯定是不成功的.因为有个依赖和mysql冲突了.于是只好卸载掉把php和mysql一起日掉,

yum remove php* mysql*

之后呢...再安装

yum -y install php php-* mysql mysql-server

好了..现在php版本是5.2.mysql的版本是5.1,然后发现mysql没启动.不管怎么折腾都没用,执行mysql_upgrade.提示

[[email protected] mysql]# mysql_upgrade
Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
Running 'mysqlcheck with default connection arguments
mysqlcheck: Got error: 2002: Can't connect to local MySQL server 
through socket '/var/lib/mysql/mysql.sock' (2) when trying to connect
FATAL ERROR: Upgrade failed

好吧.升级也不成.检查日志,发现如下提示

141010 12:38:44 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
141010 12:38:44 [ERROR] Error message file '/usr/share/mysql/english/errmsg.sys' 
had only 481 error messages,
but it should contain at least 641 error messages.
Check that the above file is the right version for this program!

只好去找个mysql的tar包来替换

wget http://mysql.llarian.net/Downloads/MySQL-5.1/mysql-5.1.73.tar.gz
tar -zxf mysql
tar -zxf mysql-5.1.73.tar.gz 
ls
cd mysql-5.1.73
mv /usr/share/mysql/english/errmsg.sys /usr/share/mysql/english/errmsg.sys.old
cp sql/share/english/errmsg.sys /usr/share/mysql/english/errmsg.sys
service mysqld restart

好了.mysql启动.去webmin获得管理员密码
执行

mysql_upgrade -uroot -p

将mysql表升级即可.


收缩
  • QQ咨询

  • 在线咨询
  • 技术支持