yumでCentOS6のphp5.3をphp5.4にアップグレード

php5.4があるyumリポジトリをインストール。

$ wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/6/x86_64/epel-release-6-5.noarch.rpm
$ wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/6/x86_64/ius-release-1.0-11.ius.el6.noarch.rpm
$ sudo rpm -ivh epel-release-6-5.noarch.rpm ius-release-1.0-11.ius.el6.noarch.rpm

httpdを停止。

$ sudo /etc/init.d/httpd stop

削除するphp5.3パッケージを確認。

$ rpm -qa | grep php
php-pear-1.9.4-4.el6.noarch
php-phpunit-File-Iterator-1.3.4-1.el6.noarch
php-symfony-yaml-2.3.9-1.el6.noarch
php-phpunit-PHPUnit-MockObject-1.2.3-1.el6.noarch
php-xml-5.3.3-40.el6_6.x86_64
php-ezc-Base-1.8-1.el6.noarch
php-common-5.3.3-40.el6_6.x86_64
php-pecl-memcached-1.0.0-1.el6.x86_64
php-channel-phpunit-1.3-3.el6.noarch
php-pecl-xdebug-2.1.4-2.el6.x86_64
php-phpunit-PHP-TokenStream-1.2.1-1.el6.noarch
php-channel-ezc-1-2.el6.noarch
php-pecl-memcache-3.0.5-4.el6.x86_64
php-cli-5.3.3-40.el6_6.x86_64
php-mysql-5.3.3-40.el6_6.x86_64
php-phpunit-PHP-Timer-1.0.5-1.el6.noarch
php-phpunit-PHP-Invoker-1.1.3-2.el6.noarch
php-soap-5.3.3-40.el6_6.x86_64
php-phpunit-PHP-CodeCoverage-1.2.13-1.el6.noarch
php-phpunit-PHPUnit-3.7.34-2.el6.noarch
php-pdo-5.3.3-40.el6_6.x86_64
php-mbstring-5.3.3-40.el6_6.x86_64
php-ezc-ConsoleTools-1.6.1-1.el6.noarch
php-phpunit-Text-Template-1.1.4-1.el6.noarch
php-symfony-common-2.3.9-1.el6.noarch
php-tidy-5.3.3-40.el6_6.x86_64

上記のうち、パッケージ名に5.3.3が付いているものをアンインストールします。

$ sudo yum erase php-xml php-common php-cli php-mysql php-soap php-pdo php-mbstring php-tidy

php5.4のパッケージを確認。

$ yum search php

php54.x86_64 : PHP scripting language for creating dynamic web sites
php54-bcmath.x86_64 : A module for PHP applications for using the bcmath library
php54-cli.x86_64 : Command-line interface for PHP
php54-common.x86_64 : Common files for PHP
php54-dba.x86_64 : A database abstraction layer module for PHP applications
php54-debuginfo.x86_64 : Debug information for package php54
php54-devel.x86_64 : Files needed for building PHP extensions
php54-embedded.x86_64 : PHP library for embedding in applications
php54-fpm.x86_64 : PHP FastCGI Process Manager
php54-gd.x86_64 : A module for PHP applications for using the gd graphics library
php54-imap.x86_64 : A module for PHP applications that use IMAP
php54-interbase.x86_64 : A module for PHP applications that use Interbase/Firebird databases
php54-intl.x86_64 : Internationalization extension for PHP applications
php54-ioncube-loader.x86_64 : IonCube Loader provides PHP Modules to read IonCube Encoded Files
php54-ioncube-loader-debuginfo.x86_64 : Debug information for package php54-ioncube-loader
php54-ldap.x86_64 : A module for PHP applications that use LDAP
php54-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
php54-mcrypt.x86_64 : Standard PHP module provides mcrypt library support
php54-mssql.x86_64 : MSSQL database module for PHP
php54-mysql.x86_64 : A module for PHP applications that use MySQL databases
php54-mysqlnd.x86_64 : A module for PHP applications that use MySQL databases
php54-odbc.x86_64 : A module for PHP applications that use ODBC databases
php54-pdo.x86_64 : A database access abstraction module for PHP applications
php54-pear.noarch : PHP Extension and Application Repository framework
php54-pecl-apc.x86_64 : APC caches and optimizes PHP intermediate code
php54-pecl-apc-debuginfo.x86_64 : Debug information for package php54-pecl-apc
php54-pecl-geoip-debuginfo.x86_64 : Debug information for package php54-pecl-geoip
php54-pecl-imagick-debuginfo.x86_64 : Debug information for package php54-pecl-imagick
php54-pecl-lzf-debuginfo.x86_64 : Debug information for package php54-pecl-lzf
php54-pecl-memcache-debuginfo.x86_64 : Debug information for package php54-pecl-memcache
php54-pecl-memcached-debuginfo.x86_64 : Debug information for package php54-pecl-memcached
php54-pecl-mongo.x86_64 : PHP MongoDB database driver
php54-pecl-mongo-debuginfo.x86_64 : Debug information for package php54-pecl-mongo
php54-pecl-mysqlnd-ms-debuginfo.x86_64 : Debug information for package php54-pecl-mysqlnd-ms
php54-pecl-redis-debuginfo.x86_64 : Debug information for package php54-pecl-redis
php54-pecl-xdebug.x86_64 : PECL package for debugging PHP scripts
php54-pecl-xdebug-debuginfo.x86_64 : Debug information for package php54-pecl-xdebug
php54-pecl-zendopcache-debuginfo.x86_64 : Debug information for package php54-pecl-zendopcache
php54-pgsql.x86_64 : A PostgreSQL database module for PHP
php54-pgsql84.x86_64 : A PostgreSQL 8.4 database module for PHP
php54-pgsql84-debuginfo.x86_64 : Debug information for package php54-pgsql84
php54-process.x86_64 : Modules for PHP script using system process interfaces
php54-pspell.x86_64 : A module for PHP applications for using pspell interfaces
php54-recode.x86_64 : A module for PHP applications for using the recode library
php54-snmp.x86_64 : A module for PHP applications that query SNMP-managed devices
php54-soap.x86_64 : A module for PHP applications that use the SOAP protocol
php54-suhosin.x86_64 : Suhosin is an advanced protection system for PHP installations
php54-suhosin-debuginfo.x86_64 : Debug information for package php54-suhosin
php54-tidy.x86_64 : Standard PHP module provides tidy library support
php54-xcache.x86_64 : PHP accelerator, optimizer, encoder and dynamic content cacher
php54-xcache-debuginfo.x86_64 : Debug information for package php54-xcache
php54-xml.x86_64 : A module for PHP applications which use XML
php54-xmlrpc.x86_64 : A module for PHP applications which use the XML-RPC protocol

php54-enchant.x86_64 : Human Language and Character Encoding Support
php54-litespeed.x86_64 : API for the Litespeed web server
php54-pecl-geoip.x86_64 : Extension to map IP addresses to geographic places
php54-pecl-imagick.x86_64 : Provides a wrapper to the ImageMagick library
php54-pecl-lzf.x86_64 : Extension to handle LZF de/compression
php54-pecl-memcache.x86_64 : Extension to work with the Memcached caching daemon
php54-pecl-memcached.x86_64 : Extension to work with the Memcached caching daemon
php54-pecl-mysqlnd-ms.x86_64 : A replication and load balancing plugin for mysqlnd
php54-pecl-mysqlnd-ms-devel.x86_64 : Mysqlnd_ms developer files (header)
php54-pecl-redis.x86_64 : Extension for communicating with the Redis key-value store
php54-pecl-zendopcache.x86_64 : The Zend OPcache

php5.4のパッケージだけ抜き出すと上記のようになる。

とりあえず全部インストールしようとすると、いくつかのパッケージが衝突するので、
自分の環境で必要なものだけ並べたコマンド。

$ sudo yum install php54 php54-bcmath php54-cli php54-common php54-dba php54-debuginfo php54-devel php54-embedded php54-fpm php54-gd php54-imap php54-interbase php54-intl php54-ioncube-loader php54-ioncube-loader-debuginfo php54-ldap php54-mbstring php54-mcrypt php54-mssql php54-mysql php54-odbc php54-pdo php54-pear php54-pecl-apc php54-pecl-apc-debuginfo php54-pecl-geoip-debuginfo php54-pecl-imagick-debuginfo php54-pecl-lzf-debuginfo php54-pecl-memcache-debuginfo php54-pecl-memcached-debuginfo php54-pecl-mongo php54-pecl-mongo-debuginfo php54-pecl-redis-debuginfo php54-pecl-xdebug php54-pecl-xdebug-debuginfo php54-pecl-zendopcache-debuginfo php54-process php54-pspell php54-recode php54-snmp php54-soap php54-suhosin php54-suhosin-debuginfo php54-tidy php54-xml php54-xmlrpc php54-enchant php54-litespeed php54-pecl-geoip php54-pecl-imagick php54-pecl-lzf php54-pecl-memcache php54-pecl-memcached php54-pecl-redis

参考URL

http://qiita.com/pakiln/items/e3351ade2bb5aeb198dc