centos5.7でphp-5.3を使う
wordpressもphp5.3が必須になったようなのでそろそろ、さくらVPSもバージョンアップをしようと思いました。
インストール状況の確認
# rpm -qa|grep php
php-cli-5.1.6-27.el5_5.3
php-devel-5.1.6-27.el5_5.3
php-pdo-5.1.6-27.el5_5.3
php-mbstring-5.1.6-27.el5_5.3
php-5.1.6-27.el5_5.3
php-mysql-5.1.6-27.el5_5.3
php-pear-1.4.9-6.el5
php-common-5.1.6-27.el5_5.3
php-gd-5.1.6-27.el5_5.3
php5.3のパッケージを確認。
[root@www ~]# yum search php53
Loaded plugins: fastestmirror
Determining fastest mirrors
* base: ftp.nara.wide.ad.jp
* extras: ftp.nara.wide.ad.jp
* updates: ftp.nara.wide.ad.jp
base | 1.1 kB 00:00
cr | 951 B 00:00
extras | 2.1 kB 00:00
extras/primary_db | 159 kB 00:00
updates | 1.9 kB 00:00
updates/primary_db | 205 kB 00:00
=================================================== Matched: php53 ====================================================
php53.x86_64 : PHP scripting language for creating dynamic web sites
php53-bcmath.x86_64 : A module for PHP applications for using the bcmath library
php53-cli.x86_64 : Command-line interface for PHP
php53-common.x86_64 : Common files for PHP
php53-dba.x86_64 : A database abstraction layer module for PHP applications
php53-devel.x86_64 : Files needed for building PHP extensions
php53-gd.x86_64 : A module for PHP applications for using the gd graphics library
php53-imap.x86_64 : A module for PHP applications that use IMAP
php53-intl.x86_64 : Internationalization extension for PHP applications
php53-ldap.x86_64 : A module for PHP applications that use LDAP
php53-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
php53-mysql.x86_64 : A module for PHP applications that use MySQL databases
php53-odbc.x86_64 : A module for PHP applications that use ODBC databases
php53-pdo.x86_64 : A database access abstraction module for PHP applications
php53-pgsql.x86_64 : A PostgreSQL database module for PHP
php53-process.x86_64 : Modules for PHP script using system process interfaces
php53-pspell.x86_64 : A module for PHP applications for using pspell interfaces
php53-snmp.x86_64 : A module for PHP applications that query SNMP-managed devices
php53-soap.x86_64 : A module for PHP applications that use the SOAP protocol
php53-xml.x86_64 : A module for PHP applications which use XML
php53-xmlrpc.x86_64 : A module for PHP applications which use the XML-RPC protocol
[root@www ~]# rpm -e php-cli php-devel php-pdo php-mbstring php php-mysql php-pear php-common php-gd
error: Failed dependencies:
php is needed by (installed) nagios-3.2.3-3.el5.rf.x86_64
nagiosの依存関係で引っかかった。
強引に削除
[root@www ~]# rpm -e --nodeps php-cli php-devel php-pdo php-mbstring php php-mysql php-pear php-common php-gd
php5.3をいれる。
[root@www ~]# yum install php53-cli php-53devel php53-pdo php53-mbstring php53 php53-mysql php53-common php53-gd Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.nara.wide.ad.jp
* extras: ftp.nara.wide.ad.jp
* updates: ftp.nara.wide.ad.jp
Setting up Install Process
No package php-53devel available.
Resolving Dependencies
--> Running transaction check
---> Package php53.x86_64 0:5.3.3-1.el5_6.1 set to be updated
---> Package php53-cli.x86_64 0:5.3.3-1.el5_6.1 set to be updated
---> Package php53-common.x86_64 0:5.3.3-1.el5_6.1 set to be updated
---> Package php53-gd.x86_64 0:5.3.3-1.el5_6.1 set to be updated
---> Package php53-mbstring.x86_64 0:5.3.3-1.el5_6.1 set to be updated
---> Package php53-mysql.x86_64 0:5.3.3-1.el5_6.1 set to be updated
---> Package php53-pdo.x86_64 0:5.3.3-1.el5_6.1 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
=======================================================================================================================
Package Arch Version Repository Size
=======================================================================================================================
Installing:
php53 x86_64 5.3.3-1.el5_6.1 base 1.3 M
php53-cli x86_64 5.3.3-1.el5_6.1 base 2.4 M
php53-common x86_64 5.3.3-1.el5_6.1 base 605 k
php53-gd x86_64 5.3.3-1.el5_6.1 base 109 k
php53-mbstring x86_64 5.3.3-1.el5_6.1 base 1.2 M
php53-mysql x86_64 5.3.3-1.el5_6.1 base 92 k
php53-pdo x86_64 5.3.3-1.el5_6.1 base 67 k
Transaction Summary
=======================================================================================================================
Install 7 Package(s)
Upgrade 0 Package(s)
Total download size: 5.7 M
Is this ok [y/N]: y
Downloading Packages:
(1/7): php53-pdo-5.3.3-1.el5_6.1.x86_64.rpm | 67 kB 00:00
(2/7): php53-mysql-5.3.3-1.el5_6.1.x86_64.rpm | 92 kB 00:00
(3/7): php53-gd-5.3.3-1.el5_6.1.x86_64.rpm | 109 kB 00:00
(4/7): php53-common-5.3.3-1.el5_6.1.x86_64.rpm | 605 kB 00:00
(5/7): php53-mbstring-5.3.3-1.el5_6.1.x86_64.rpm | 1.2 MB 00:00
(6/7): php53-5.3.3-1.el5_6.1.x86_64.rpm | 1.3 MB 00:00
(7/7): php53-cli-5.3.3-1.el5_6.1.x86_64.rpm | 2.4 MB 00:00
-----------------------------------------------------------------------------------------------------------------------
Total 10 MB/s | 5.7 MB 00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : php53-common 1/7
Installing : php53-pdo 2/7
Installing : php53-cli 3/7
Installing : php53 4/7
Installing : php53-mysql 5/7
Installing : php53-mbstring 6/7
Installing : php53-gd 7/7
Installed:
php53.x86_64 0:5.3.3-1.el5_6.1 php53-cli.x86_64 0:5.3.3-1.el5_6.1 php53-common.x86_64 0:5.3.3-1.el5_6.1
php53-gd.x86_64 0:5.3.3-1.el5_6.1 php53-mbstring.x86_64 0:5.3.3-1.el5_6.1 php53-mysql.x86_64 0:5.3.3-1.el5_6.1
php53-pdo.x86_64 0:5.3.3-1.el5_6.1
Complete!
httpdの再起動。
[root@www ~]# /etc/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
なんとなくnagiosも再起動
[root@www ~]# /etc/init.d/nagios restart
Stopping nagios: [ OK ]
Starting nagios: [ OK ]
最後にphpinfoで確認して、無事完了です。
フォローしませんか?