upwifi

Centos5.6 简单方法升级php到php5.3.3


#wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
#wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
#rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm
 
#vi /etc/yum.repos.d/remi.repo
#vi /etc/yum.repos.d/epel.repo
#vi /etc/yum.repos.d/epel-testing.repo
分别在这三个文件的最后,增加如下一行:
priority=1
 
#yum --enablerepo=remi update php
 
# php -v
 
PHP 5.3.6 (cli) (built: May 16 2011 19:18:00)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
 
PS:
当前安装时CentOS已经更新到5.3,所以实际下载的包可能有所不同:
wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
wget http://rpms.famillecollet.com/el5.i386/remi-release-5-7.el5.remi.noarch.rpm
rpm -Uvh remi-release-5-7.el5.remi.noarch.rpm epel-release-5-4.noarch.rpm
如果单独升级php将提示失败,只有联通mysql一起升级才可以,
所以我们必须执行以下命令才能升级php到5.2.9版本:
yum –-enablerepo=remi update php* mysql*
 
提示:"缺少mysqli扩展""缺少mcrypt扩展" 解决方式
 
[root@www libraries]# yum --enablerepo=remi update php-mysqli
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.isu.edu.tw
 * epel: mirror.nus.edu.sg
 

Centos5.6 简单方法升级php到php5.3.3

来源:本站转载 作者:佚名 时间:2013-01-31 13:06:42

 一、版本环境

# rpm -q php

二、用Yum 升级PHP

# yum update php

Could not find update match for php No Packages marked for Update 看来Centos系统软件仓库中的php没有更新,又不想重新手动编译安装php,既然官方的yum源里面没有,那就添加一个源吧!

#  rpm –import http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka #  vim/etc/yum.repos.d/utterramblings.repo 在打开的文件中加入以下内容:
[utterramblings] name=Jason’s Utter Ramblings Repo baseurl=http://www.jasonlitka.com/media/EL$releasever/$basearch/ enabled=1 gpgcheck=1 gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka 保存退出

# yum update php (在更新PHP时候mysql一起更新并报错;处理在第三大点)

Transaction Check Error:   file /etc/my.cnf from install of mysql-5.1.58-jason.1.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.i386

# yum update mysql

三、更新PHP时mysql报错的处理

1、首先把原本的PHP版本删除

# yum remove php*

2、查看一下是否删除

# rpm -q php

删除成功:package php is not installed

3、安装PHP53

# yum -y install php53*

注意:

php53-odbc64-5.3.3-2.el5.x86_64 from base has depsolving problems   --> php53-odbc64 conflicts with php53-odbc Error: php53-odbc64 conflicts with php53-odbc  You could try using --skip-broken to work around the problem  You could try running: package-cleanup --problems                         package-cleanup --dupes                         rpm -Va --nofiles --nodigest The program package-cleanup is found in the yum-utils package.

# yum -y install php53* --skip-broken

安装成功会最后出现Complete!

分类:

技术点:

相关文章: