weiliwei 发表于 2018-12-20 06:31:41

yum 升级PHP到5.3*

  由于安装Roundcube PHP出现诸多问题,索性全部升级到5.3一下内容为转载






  第一步:使用命令 yum list mysql php 检查标准yum源是否有mysql和php的可用新版本,发现标准yum源并没有更新。
  第二步:寻找其他源。找到http://download.fedora.redhat.com/pub/epel/5/i386/有些库可以用。执行下面命令:



[*]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-*.noarch.rpm

  第三步:编辑/etc/yum.repos.d/remi.repo
  #vi /etc/yum.repos.d/remi.repo
  在这个文件的最后增加一行:priority=1
  保存退出。
  第四步:编辑/etc/yum.repos.d/epel-testing.repo,
  #vi /etc/yum.repos.d/epel-testing.repo
  在这个文件的最后增加一行:priority=1
  保存退出。
  第五步:编辑/etc/yum.repos.d/epel.repo
  #vi /etc/yum.repos.d/epel.repo
  在这个文件的最后增加一行:priority=1
  保存退出。
  第六步:使用

yum --enablerepo=remi list mysql php  检查是否有可升级版本。发现有版本可以升级到mysql5.5.11和php5.3.6。
  第七步:使用命令yum --enablerepo=remi update mysql 进行升级,升级mysql的时候会一并升级PHP,有些提示我都选择Y,直到升级结束。整个过程包含下载、安装。
  第八步:Mysql升级后的配置:
1,升级完成mysql后,原有的my.cnf已经不适合了,现将/etc/my.cnf备份,然后将/etc/my.cnf.rpmnew修改为/etc/my.cnf。
2,升级和修复table一适应新版本:mysqlcheck –all-databases –check-upgrade –auto-repair -p
  第九步:Zend Optimizer已经不支持PHP5.3,需要安装Zend Guard Loader。依次执行下面命令进行安装:
wget www.myacg.pp.ru/ZendGuardLoader.so
mkdir -p /usr/local/zend
mv ZendGuardLoader.so /usr/local/zend/
vi /usr/local/lsws/lsphp5/lib/php.ini
然后修改php.ini: zend_extension=/usr/local/zend/ZendGuardLoader.so
  至此,大功告成,重启mysql,apahe 就可以了。
  以上内容为网友同时升级mysql php的过程,可是我只想升级php,使用
  yum --enablerepo=remi list php
  可以查询到php的更新包为php 5.3.3,但是使用
  yum --enablerepo=remi update php

  却无法安装,于是我想到用yum extender软件来安装,直接搜索php,可以看到可以更新,勾选php更新,提示有错误:
  php53-common conflicts with php-common

  再搜索看,需要删除到原先的php5.1版本,运行:

  yum remove phpRunning Transaction

  Erasing      : php-pdo                                                 1/12

  Erasing      : php-mbstring                                          2/12

  Erasing      : php-gd                                                3/12

  Erasing      : php-common                                              4/12

  warning: /etc/php.ini saved as /etc/php.ini.rpmsave

  Erasing      : php-cli                                                 5/12

  Erasing      : php-mysql                                             6/12

  Erasing      : php-pecl-zip                                          7/12

  Erasing      : php-odbc                                                8/12

  Erasing      : php-xmlrpc                                              9/12

  Erasing      : php-imap                                             10/12

  Erasing      : php-xml                                                11/12

  Erasing      : php-ldap                                             12/12

  然后再选中所有的php5.3开头的包,安装就OK了。

  重启apache,phpmyadmin就可以正常登录了。

  运行phpmyadmin后提示缺少mcrypt模块扩展。



为了解决缺少mcrypt模块扩展提示的问题,有搜索了了一下,结果可以直接安装。

yum --enablerepo=remi list php-mcrypt

结果显示有5.3.3版本。

yum --enablerepo=remi install php-mcrypt

总是提示有冲突,原来我安装的php5.3是有问题的。

正确的php5.3包应该是php-5.3.3-3.el5

而我的是php53-5.3.3...

所以在yum extender中卸载掉所有的php53开头的包。

使用命令yum --enablerepo=remi list php

显示可以安装php-5.3.6

于是就安装了

yum --enablerepo=remi list php.i386
Dependencies Resolved
================================================================================
Package         Arch      Version                        Repository   Size
================================================================================
Installing:
php               i386      5.3.6-3.el5.remi               remi      1.3 M
Installing for dependencies:
libedit         i386      2.11-2.20080712cvs.el5         epel         79 k
php-cli         i386      5.3.6-3.el5.remi               remi      2.6 M
php-common      i386      5.3.6-3.el5.remi               remi      970 k
然后再将那些卸载的都安装上。
# yum --enablerepo=remi list php-bcmatch php-dba php-develphp-gd php-imap php-intl php-ldap php-mbstring php-mysql php-odbcphp-pdo php-snmp php-soap php-xml php-xmlrpc php-pgsql php-processphp-pspell
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
* epel: mirror.bjtu.edu.cn
* remi: iut-info.univ-reims.fr
Available Packages
php-dba.i386                        5.3.6-3.el5.remi                      remi
php-devel.i386                        5.3.6-3.el5.remi                      remi
php-gd.i386                           5.3.6-3.el5.remi                      remi
php-imap.i386                         5.3.6-3.el5.remi                      remi
php-intl.i386                         5.3.6-3.el5.remi                      remi
php-ldap.i386                         5.3.6-3.el5.remi                      remi
php-mbstring.i386                     5.3.6-3.el5.remi                      remi
php-mysql.i386                        5.3.6-3.el5.remi                      remi
php-odbc.i386                         5.3.6-3.el5.remi                      remi
php-pdo.i386                        5.3.6-3.el5.remi                      remi
php-pgsql.i386                        5.3.6-3.el5.remi                      remi
php-process.i386                      5.3.6-3.el5.remi                      remi
php-pspell.i386                     5.3.6-3.el5.remi                      remi
php-snmp.i386                         5.3.6-3.el5.remi                      remi
php-soap.i386                         5.3.6-3.el5.remi                      remi
php-xml.i386                        5.3.6-3.el5.remi                      remi
php-xmlrpc.i386                     5.3.6-3.el5.remi                      remi
结果显示
   file /usr/share/mysql/greek/errmsg.sys from install ofmysql-libs-5.5.12-1.el5.remi.i386 conflicts with file from packagemysql-5.0.77-4.el5_6.6.i386
CentOS 5.6坑爹啊!
得了,升级mysql呗。上面主要是不想升级mysql,现在继续折腾:
# yum --enablerepo=remi update mysql
Dependencies Resolved
================================================================================
Package            Arch      Version                     Repository   Size
================================================================================
Updating:
mysql                i386      5.5.12-1.el5.remi         remi      7.5 M
Installing for dependencies:
mysql-libs         i386      5.5.12-1.el5.remi         remi      1.1 M
mysqlclient15      i386      5.0.67-1.el5.remi         remi      1.3 M
Updating for dependencies:
mysql-server         i386      5.5.12-1.el5.remi         remi         12 M
Transaction Summary
================================================================================
Install       2 Package(s)
Upgrade       2 Package(s)
更新完成以后,再安装其他:
# yum --enablerepo=remi install php-bcmatch php-dba php-develphp-gd php-imap php-intl php-ldap php-mbstring php-mysql php-odbcphp-pdo php-snmp php-soap php-xml php-xmlrpc php-pgsql php-processphp-pspell
Transaction Summary
================================================================================
Install      18 Package(s)
Upgrade       0 Package(s)
Total size: 4.7 M
Is this ok : y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing   : php-pdo                                                 1/18
Installing   : t1lib                                                   2/18
Installing   : php-dba                                                 3/18
Installing   : php-mysql                                             4/18
Installing   : php-pspell                                              5/18
Installing   : php-odbc                                                6/18
Installing   : php-intl                                                7/18
Installing   : php-pgsql                                             8/18
Installing   : php-xml                                                 9/18
Installing   : php-gd                                                 10/18
Installing   : php-soap                                             11/18
Installing   : php-process                                          12/18
Installing   : php-devel                                              13/18
Installing   : php-snmp                                             14/18
Installing   : php-xmlrpc                                             15/18
Installing   : php-imap                                             16/18
Installing   : php-mbstring                                           17/18
Installing   : php-ldap                                             18/18
Installed:
php-dba.i386 0:5.3.6-3.el5.remi         php-devel.i386 0:5.3.6-3.el5.remi   
php-gd.i386 0:5.3.6-3.el5.remi          php-imap.i386 0:5.3.6-3.el5.remi      
php-intl.i386 0:5.3.6-3.el5.remi      php-ldap.i386 0:5.3.6-3.el5.remi      
php-mbstring.i386 0:5.3.6-3.el5.remi    php-mysql.i386 0:5.3.6-3.el5.remi   
php-odbc.i386 0:5.3.6-3.el5.remi      php-pdo.i386 0:5.3.6-3.el5.remi      
php-pgsql.i386 0:5.3.6-3.el5.remi       php-process.i386 0:5.3.6-3.el5.remi   
php-pspell.i386 0:5.3.6-3.el5.remi      php-snmp.i386 0:5.3.6-3.el5.remi      
php-soap.i386 0:5.3.6-3.el5.remi      php-xml.i386 0:5.3.6-3.el5.remi      
php-xmlrpc.i386 0:5.3.6-3.el5.remi   
Dependency Installed:
t1lib.i386 0:5.1.1-7.el5                                                      
Complete!
再运行:
# yum --enablerepo=remi install php-mcrypt
Dependencies Resolved
================================================================================
Package         Arch      Version                      Repository   Size
================================================================================
Installing:
php-mcrypt      i386      5.3.6-3.el5.remi             remi         45 k
Installing for dependencies:
libmcrypt         i386      2.5.8-4.el5.centos         extras      116 k
Transaction Summary
================================================================================
Install       2 Package(s)
Upgrade       0 Package(s)
Total size: 160 k
Total download size: 116 k
Is this ok : y
Downloading Packages:
libmcrypt-2.5.8-4.el5.centos.i386.rpm                  | 116 kB   00:01   
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing   : libmcrypt                                                1/2
Installing   : php-mcrypt                                             2/2
Installed:
php-mcrypt.i386 0:5.3.6-3.el5.remi                                          
Dependency Installed:
libmcrypt.i386 0:2.5.8-4.el5.centos                                          
Complete!
重启Apahce,搞定!




页: [1]
查看完整版本: yum 升级PHP到5.3*