タグ別アーカイブ: PHP

PHP BLT #2 で LT してきた話

もう先週の出来事になってしまったが、メルカリオフィス@六本木ヒルズで PHP BLT の第 2 回が開催された。

LT 枠で応募して、無事に滑りこむことが出来た。20 枠もあればすんなり入れるだろうと思ってたが、思いの外応募が多くて BLT ブランドすごいなと思った。

メルカリオフィスにつくと、だだっ広いスペースの一角が会場として準備されていた。メルカリは絶賛増床中だそうで、勢いを感じた。
PHP7 リリース直後ということもあり、PHP7 ネタは大いにかぶる可能性があったのであえてそのネタは外して、SensioLabs が出してる Security Checker の話をした。

この checker は以前話題になっていた「ぼくの考えた最強の開発フロー PHP編」の中でちらっと紹介されていたもので、その後この checker についても伸びるかなーと思っていたが、案外日本語の記事が全然現れてこないので、発表することにした。

スライドを読んでいただければ全て書いてあるが、自分のプロジェクトで使用しているライブラリの脆弱性チェックをしてくれるというツールで、それを CI に組み込んでしまえば、普段意識せずに開発できて良い感じですよというもの。

注意点としては、絶対の信頼をおいちゃダメだよってことで、JVN など一次ソースをあたることも忘れちゃならない。

スライド中で、Lumen に組み込んだ CI のサンプル用リポジトリへのリンクをはっていますが、面倒な方はこちらからどうぞ。

https://github.com/serima/security-checker-on-lumen

 

個人的には、packagist.jp の方が来ていたのがテンション上がった。いつもお世話になっていたので…、そしてメルカリに入社していたことにびっくり。タレント揃えてる感あるなーと。

イベントまとめとしてはここがとても良くまとまっているので興味ある方は是非。

PHP BLT #2 に参加してきました

余談ですが、@uzulla さんがトップバッターの LT ってその後のハードル上がるからやめてほしい…

CentOS 5.5にPHP 5.3.4とMySQL 5.1.53をインストールする。

さくらのVPSでSymfonyを使うためにPHP5.1.6から5.3.4へアップデートします。
(5.3.3にアップデートするつもりだったのですが、タイミングよく5.3.4がリリースされていました)

まずは、今入っているPHPとMySQLのバージョンを確認する。

[shell]
$ php -v
PHP 5.1.6 (cli) (built: Nov 29 2010 16:47:46)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
$ rpm -qa | grep php | sort
php-5.1.6-27.el5_5.3
php-cli-5.1.6-27.el5_5.3
php-common-5.1.6-27.el5_5.3
php-devel-5.1.6-27.el5_5.3
php-mbstring-5.1.6-27.el5_5.3
php-mysql-5.1.6-27.el5_5.3
php-pdo-5.1.6-27.el5_5.3
php-pear-1.4.9-6.el5
php-pear-Auth-SASL-1.0.2-4.el5.centos
php-pear-Date-1.4.7-2.el5.centos
php-pear-File-1.2.2-1.el5.centos
php-pear-HTTP-Request-1.4.2-1.el5.centos
php-pear-Log-1.9.13-1.el5.centos
php-pear-MDB2-2.4.1-2.el5.centos
php-pear-MDB2-Driver-mysql-1.4.1-3.el5.centos
php-pear-Mail-1.1.14-1.el5.centos
php-pear-Mail-Mime-1.4.0-1.el5.centos
php-pear-Net-SMTP-1.2.10-1.el5.centos
php-pear-Net-Sieve-1.1.5-2.el5.centos
php-pear-Net-Socket-1.0.8-1.el5.centos
php-pear-Net-URL-1.0.15-1.el5.centos
php-pear-db-1.7.13-2.el5.rf
php-tidy-5.1.6-15.el5.centos.1
$ mysql –version
mysql Ver 14.12 Distrib 5.0.77, for redhat-linux-gnu (x86_64) using readline 5.1
$ rpm -qa | grep mysql | sort
mysql-5.0.77-4.el5_5.4
mysql-server-5.0.77-4.el5_5.4
php-mysql-5.1.6-27.el5_5.3
php-pear-MDB2-Driver-mysql-1.4.1-3.el5.centos
[/shell]

epelリポジトリ登録をします。

[shell]
$ sudo rpm -ivh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm を取得中
警告: /var/tmp/rpm-xfer.GxVSsL: ヘッダ V3 DSA signature: NOKEY, key ID 217521f6
準備中… ########################################### [100%]
1:epel-release ########################################### [100%]
[/shell]
remiリポジトリ登録をします。
[shell]
$ sudo rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
http://rpms.famillecollet.com/enterprise/remi-release-5.rpm を取得中
警告: /var/tmp/rpm-xfer.OnEPUe: ヘッダ V4 DSA signature: NOKEY, key ID 00f97f56
準備中… ########################################### [100%]
1:remi-release ########################################### [100%]
[/shell]
PHP 5.3.3の存在を確認。
[shell]
$ yum info php –enablerepo=remi
Loaded plugins: fastestmirror
addons | 951 B 00:00
base | 2.1 kB 00:00
epel | 3.7 kB 00:00
epel/primary_db | 3.4 MB 00:00
extras | 2.1 kB 00:00
remi | 2.6 kB 00:00
remi/primary_db | 237 kB 00:01
rpmforge | 1.1 kB 00:00
rpmforge 10152/10152
updates | 1.9 kB 00:00
updates/primary_db | 1.0 MB 00:00
Installed Packages
Name : php
Arch : x86_64
Version : 5.1.6
Release : 27.el5_5.3
Size : 6.2 M
Repo : installed
Summary : PHP HTML 埋め込みのスクリプト言語 (PHP: Hypertext Preprocessor)
URL : http://www.php.net/
License : The PHP License v3.01
Description: PHP is an HTML-embedded scripting language. PHP attempts to make it
: easy for developers to write dynamically generated webpages. PHP
: also offers built-in database integration for several commercial
: and non-commercial database management systems, so writing a
: database-enabled webpage with PHP is fairly simple. The most common
: use of PHP coding is probably as a replacement for CGI scripts.
:
: The php package contains the module which adds support for the PHP
: language to Apache HTTP Server.
Available Packages
Name : php
Arch : x86_64
Version : 5.3.4
Release : 1.el5.remi
Size : 1.4 M
Repo : remi
Summary : PHP scripting language for creating dynamic web sites
URL : http://www.php.net/
License : PHP
Description: PHP is an HTML-embedded scripting language. PHP attempts to make it
: easy for developers to write dynamically generated web pages. PHP
: also offers built-in database integration for several commercial
: and non-commercial database management systems, so writing a
: database-enabled webpage with PHP is fairly simple. The most common
: use of PHP coding is probably as a replacement for CGI scripts.
:
: The php package contains the module which adds support for the PHP
: language to Apache HTTP Server.
[/shell]
あれ?5.3.4がある。調べてみると、2010/12/11にアップデートされていました。
Stableなようなので、当然こちらをインストールします。
[shell]
# yum remove php php-* mysql
Loaded plugins: fastestmirror
Setting up Remove Process
Resolving Dependencies
–> Running transaction check
—> Package mysql.x86_64 0:5.0.77-4.el5_5.4 set to be erased
–> Processing Dependency: libmysqlclient.so.15()(64bit) for package: dovecot
–> Processing Dependency: libmysqlclient.so.15()(64bit) for package: mysql-serv er
–> Processing Dependency: libmysqlclient.so.15()(64bit) for package: perl-DBD-M ySQL
–> Processing Dependency: libmysqlclient.so.15(libmysqlclient_15)(64bit) for pa ckage: dovecot
–> Processing Dependency: libmysqlclient.so.15(libmysqlclient_15)(64bit) for pa ckage: mysql-server
–> Processing Dependency: libmysqlclient.so.15(libmysqlclient_15)(64bit) for pa ckage: perl-DBD-MySQL
–> Processing Dependency: libmysqlclient_r.so.15()(64bit) for package: mysql-se rver
–> Processing Dependency: libmysqlclient_r.so.15(libmysqlclient_15)(64bit) for package: mysql-server
–> Processing Dependency: mysql = 5.0.77-4.el5_5.4 for package: mysql-server
—> Package php.x86_64 0:5.1.6-27.el5_5.3 set to be erased
—> Package php-cli.x86_64 0:5.1.6-27.el5_5.3 set to be erased
—> Package php-common.x86_64 0:5.1.6-27.el5_5.3 set to be erased
—> Package php-devel.x86_64 0:5.1.6-27.el5_5.3 set to be erased
—> Package php-mbstring.x86_64 0:5.1.6-27.el5_5.3 set to be erased
—> Package php-mysql.x86_64 0:5.1.6-27.el5_5.3 set to be erased
—> Package php-pdo.x86_64 0:5.1.6-27.el5_5.3 set to be erased
—> Package php-pear.noarch 1:1.4.9-6.el5 set to be erased
—> Package php-pear-Auth-SASL.noarch 0:1.0.2-4.el5.centos set to be erased
—> Package php-pear-Date.noarch 0:1.4.7-2.el5.centos set to be erased
—> Package php-pear-File.noarch 0:1.2.2-1.el5.centos set to be erased
—> Package php-pear-HTTP-Request.noarch 0:1.4.2-1.el5.centos set to be erased
—> Package php-pear-Log.noarch 0:1.9.13-1.el5.centos set to be erased
—> Package php-pear-MDB2.noarch 0:2.4.1-2.el5.centos set to be erased
—> Package php-pear-MDB2-Driver-mysql.noarch 0:1.4.1-3.el5.centos set to be er ased
—> Package php-pear-Mail.noarch 0:1.1.14-1.el5.centos set to be erased
—> Package php-pear-Mail-Mime.noarch 0:1.4.0-1.el5.centos set to be erased
—> Package php-pear-Net-SMTP.noarch 0:1.2.10-1.el5.centos set to be erased
—> Package php-pear-Net-Sieve.noarch 0:1.1.5-2.el5.centos set to be erased
—> Package php-pear-Net-Socket.noarch 0:1.0.8-1.el5.centos set to be erased
—> Package php-pear-Net-URL.noarch 0:1.0.15-1.el5.centos set to be erased
—> Package php-pear-db.noarch 0:1.7.13-2.el5.rf set to be erased
—> Package php-tidy.x86_64 0:5.1.6-15.el5.centos.1 set to be erased
–> Running transaction check
—> Package dovecot.x86_64 0:1.0.7-7.el5 set to be erased
—> Package mysql-server.x86_64 0:5.0.77-4.el5_5.4 set to be erased
—> Package perl-DBD-MySQL.x86_64 0:3.0007-2.el5 set to be erased
–> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Removing:
mysql x86_64 5.0.77-4.el5_5.4 installed 8.1 M
php x86_64 5.1.6-27.el5_5.3 installed 6.2 M
php-cli x86_64 5.1.6-27.el5_5.3 installed 5.3 M
php-common x86_64 5.1.6-27.el5_5.3 installed 397 k
php-devel x86_64 5.1.6-27.el5_5.3 installed 2.5 M
php-mbstring x86_64 5.1.6-27.el5_5.3 installed 1.8 M
php-mysql x86_64 5.1.6-27.el5_5.3 installed 196 k
php-pdo x86_64 5.1.6-27.el5_5.3 installed 114 k
php-pear noarch 1:1.4.9-6.el5 installed 1.8 M
php-pear-Auth-SASL noarch 1.0.2-4.el5.centos installed 33 k
php-pear-Date noarch 1.4.7-2.el5.centos installed 402 k
php-pear-File noarch 1.2.2-1.el5.centos installed 74 k
php-pear-HTTP-Request noarch 1.4.2-1.el5.centos installed 70 k
php-pear-Log noarch 1.9.13-1.el5.centos installed 204 k
php-pear-MDB2 noarch 2.4.1-2.el5.centos installed 724 k
php-pear-MDB2-Driver-mysql noarch 1.4.1-3.el5.centos installed 184 k
php-pear-Mail noarch 1.1.14-1.el5.centos installed 85 k
php-pear-Mail-Mime noarch 1.4.0-1.el5.centos installed 126 k
php-pear-Net-SMTP noarch 1.2.10-1.el5.centos installed 50 k
php-pear-Net-Sieve noarch 1.1.5-2.el5.centos installed 253 k
php-pear-Net-Socket noarch 1.0.8-1.el5.centos installed 26 k
php-pear-Net-URL noarch 1.0.15-1.el5.centos installed 26 k
php-pear-db noarch 1.7.13-2.el5.rf installed 676 k
php-tidy x86_64 5.1.6-15.el5.centos.1 installed 46 k
Removing for dependencies:
dovecot x86_64 1.0.7-7.el5 installed 3.7 M
mysql-server x86_64 5.0.77-4.el5_5.4 installed 22 M
perl-DBD-MySQL x86_64 3.0007-2.el5 installed 328 k
Transaction Summary
================================================================================
Remove 27 Package(s)
Reinstall 0 Package(s)
Downgrade 0 Package(s)
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Erasing : php-pear-Net-Sieve 1/27
Erasing : php-common 2/27
警告: /etc/php.ini は /etc/php.ini.rpmsave として保存されました。
Erasing : php-mbstring 3/27
Erasing : php-pdo 4/27
Erasing : php-pear-Mail 5/27
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib64/php/modules/pdo_mysql.so’ – /usr/lib64/php/modules/pdo_mysql.so: undefined symbol: php_pdo_register_driver in Unknown on line 0
Erasing : php-pear-Date 6/27
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib64/php/modules/pdo_mysql.so’ – /usr/lib64/php/modules/pdo_mysql.so: undefined symbol: php_pdo_register_driver in Unknown on line 0
Erasing : php-tidy 7/27
Erasing : php-mysql 8/27
Erasing : php-pear-Net-SMTP 9/27
Erasing : php-devel 10/27
Erasing : php-pear-MDB2 11/27
Erasing : php 12/27
Erasing : php-pear-MDB2-Driver-mysql 13/27
Erasing : php-pear-Net-URL 14/27
Erasing : mysql 15/27
警告: /etc/my.cnf は /etc/my.cnf.rpmsave として保存されました。
Erasing : mysql-server 16/27
警告: /var/log/mysqld.log は /var/log/mysqld.log.rpmsave として保存されました。
Erasing : php-pear-Mail-Mime 17/27
Erasing : php-cli 18/27
Erasing : dovecot 19/27
警告: /etc/dovecot.conf は /etc/dovecot.conf.rpmsave として保存されました。
Erasing : php-pear-File 20/27
/usr/bin/pear: line 2: /usr/bin/php: そのようなファイルやディレクトリはありません
/usr/bin/pear: line 2: exec: /usr/bin/php: cannot execute: そのようなファイルやディレクトリはありません
Erasing : php-pear-db 21/27
Erasing : php-pear-Auth-SASL 22/27
/usr/bin/pear: line 2: /usr/bin/php: そのようなファイルやディレクトリはありません
/usr/bin/pear: line 2: exec: /usr/bin/php: cannot execute: そのようなファイルやディレクトリはありません
Erasing : php-pear-Net-Socket 23/27
/usr/bin/pear: line 2: /usr/bin/php: そのようなファイルやディレクトリはありません
/usr/bin/pear: line 2: exec: /usr/bin/php: cannot execute: そのようなファイルやディレクトリはありません
Erasing : php-pear-HTTP-Request 24/27
/usr/bin/pear: line 2: /usr/bin/php: そのようなファイルやディレクトリはありません
/usr/bin/pear: line 2: exec: /usr/bin/php: cannot execute: そのようなファイルやディレクトリはありません
Erasing : php-pear-Log 25/27
/usr/bin/pear: line 2: /usr/bin/php: そのようなファイルやディレクトリはありません
/usr/bin/pear: line 2: exec: /usr/bin/php: cannot execute: そのようなファイルやディレクトリはありません
Erasing : perl-DBD-MySQL 26/27
Erasing : php-pear 27/27
Removed:
mysql.x86_64 0:5.0.77-4.el5_5.4 php.x86_64 0:5.1.6-27.el5_5.3 php-cli.x86_64 0:5.1.6-27.el5_5.3 php-common.x86_64 0:5.1.6-27.el5_5.3
php-devel.x86_64 0:5.1.6-27.el5_5.3 php-mbstring.x86_64 0:5.1.6-27.el5_5.3 php-mysql.x86_64 0:5.1.6-27.el5_5.3 php-pdo.x86_64 0:5.1.6-27.el5_5.3
php-pear.noarch 1:1.4.9-6.el5 php-pear-Auth-SASL.noarch 0:1.0.2-4.el5.centos php-pear-Date.noarch 0:1.4.7-2.el5.centos php-pear-File.noarch 0:1.2.2-1.el5.centos
php-pear-HTTP-Request.noarch 0:1.4.2-1.el5.centos php-pear-Log.noarch 0:1.9.13-1.el5.centos php-pear-MDB2.noarch 0:2.4.1-2.el5.centos php-pear-MDB2-Driver-mysql.noarch 0:1.4.1-3.el5.centos
php-pear-Mail.noarch 0:1.1.14-1.el5.centos php-pear-Mail-Mime.noarch 0:1.4.0-1.el5.centos php-pear-Net-SMTP.noarch 0:1.2.10-1.el5.centos php-pear-Net-Sieve.noarch 0:1.1.5-2.el5.centos
php-pear-Net-Socket.noarch 0:1.0.8-1.el5.centos php-pear-Net-URL.noarch 0:1.0.15-1.el5.centos php-pear-db.noarch 0:1.7.13-2.el5.rf php-tidy.x86_64 0:5.1.6-15.el5.centos.1
Dependency Removed:
dovecot.x86_64 0:1.0.7-7.el5 mysql-server.x86_64 0:5.0.77-4.el5_5.4 perl-DBD-MySQL.x86_64 0:3.0007-2.el5
Complete!
[/shell]
アンインストールしたパッケージを全て入れ直します。
[shell]
# yum install php-pear-Net-Sieve php-common php-mbstring php-pdo php-pear-Mail php-tidy php-mysql php-pear-Net-SMTP php-devel php-pear-MDB2 php php-pear-MDB2-Driver-mysql php-pear-Net-URL mysql mysql-server php-pear-Mail-Mime php-cli dovecot php-pear-File php-pear-db php-pear-Auth-SASL php-pear-Net-Socket php-pear-HTTP-Request php-pear-Log perl-DBD-MySQL php-pear … –enablerepo=remi
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: ftp.nara.wide.ad.jp
* base: ftp.nara.wide.ad.jp
* epel: ftp.iij.ad.jp
* extras: ftp.nara.wide.ad.jp
* remi: rpms.famillecollet.com
* rpmforge: fr2.rpmfind.net
* updates: ftp.nara.wide.ad.jp
addons | 951 B 00:00
base | 2.1 kB 00:00
epel | 3.7 kB 00:00
epel/primary_db | 3.4 MB 00:00
extras | 2.1 kB 00:00
remi | 2.6 kB 00:00
remi/primary_db | 237 kB 00:01
rpmforge | 1.1 kB 00:00
updates | 1.9 kB 00:00
updates/primary_db | 1.0 MB 00:00
Setting up Install Process
No package … available.
Resolving Dependencies
–> Running transaction check
—> Package dovecot.x86_64 0:1.0.7-7.el5 set to be updated
–> Processing Dependency: libmysqlclient.so.15(libmysqlclient_15)(64bit) for package: dovecot
–> Processing Dependency: libmysqlclient.so.15()(64bit) for package: dovecot
—> Package mysql.i386 0:5.0.77-4.el5_5.4 set to be updated
—> Package mysql.x86_64 0:5.1.53-1.el5.remi set to be updated
–> Processing Dependency: mysql-libs = 5.1.53-1.el5.remi for package: mysql
–> Processing Dependency: libmysqlclient_r.so.16(libmysqlclient_16)(64bit) for package: mysql
–> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: mysql
–> Processing Dependency: libmysqlclient.so.16()(64bit) for package: mysql
–> Processing Dependency: libmysqlclient_r.so.16()(64bit) for package: mysql
—> Package mysql-server.x86_64 0:5.1.53-1.el5.remi set to be updated
—> Package perl-DBD-MySQL.x86_64 0:3.0007-2.el5 set to be updated
—> Package php.x86_64 0:5.3.4-1.el5.remi set to be updated
—> Package php-cli.x86_64 0:5.3.4-1.el5.remi set to be updated
–> Processing Dependency: libedit.so.0()(64bit) for package: php-cli
—> Package php-common.x86_64 0:5.3.4-1.el5.remi set to be updated
—> Package php-devel.x86_64 0:5.3.4-1.el5.remi set to be updated
—> Package php-mbstring.x86_64 0:5.3.4-1.el5.remi set to be updated
—> Package php-mysql.x86_64 0:5.3.4-1.el5.remi set to be updated
—> Package php-pdo.x86_64 0:5.3.4-1.el5.remi set to be updated
—> Package php-pear.noarch 1:1.9.1-6.el5.remi set to be updated
—> Package php-pear-Auth-SASL.noarch 0:1.0.4-1.el5.remi set to be updated
—> Package php-pear-File.noarch 0:1.3.0-2.el5.remi set to be updated
—> Package php-pear-HTTP-Request.noarch 0:1.4.4-1.el5.remi set to be updated
—> Package php-pear-Log.noarch 0:1.12.4-1.el5.remi.1 set to be updated
—> Package php-pear-MDB2.noarch 0:2.4.1-2.el5.centos set to be updated
—> Package php-pear-MDB2-Driver-mysql.noarch 0:1.4.1-3.el5.centos set to be updated
—> Package php-pear-Mail.noarch 0:1.2.0-1.el5.remi set to be updated
—> Package php-pear-Mail-Mime.noarch 0:1.8.1-1.el5.remi set to be updated
—> Package php-pear-Net-SMTP.noarch 0:1.4.4-1.el5.remi set to be updated
—> Package php-pear-Net-Sieve.noarch 0:1.3.0-1.el5.remi set to be updated
—> Package php-pear-Net-Socket.noarch 0:1.0.10-1.el5.remi set to be updated
—> Package php-pear-Net-URL.noarch 0:1.0.15-1.el5.centos set to be updated
—> Package php-pear-db.noarch 0:1.7.13-2.el5.rf set to be updated
—> Package php-tidy.x86_64 0:5.3.4-1.el5.remi set to be updated
–> Running transaction check
—> Package libedit.x86_64 0:20090923-3.0_1.el5.rf set to be updated
—> Package mysql-libs.x86_64 0:5.1.53-1.el5.remi set to be updated
—> Package mysqlclient15.x86_64 0:5.0.67-1.el5.remi set to be updated
–> Finished Dependency Resolution
Dependencies Resolved
==================================================================================================================================================================================================================
Package Arch Version Repository Size
==================================================================================================================================================================================================================
Installing:
dovecot x86_64 1.0.7-7.el5 base 1.7 M
mysql i386 5.0.77-4.el5_5.4 updates 4.8 M
mysql x86_64 5.1.53-1.el5.remi remi 1.1 M
mysql-server x86_64 5.1.53-1.el5.remi remi 11 M
perl-DBD-MySQL x86_64 3.0007-2.el5 base 148 k
php x86_64 5.3.4-1.el5.remi remi 1.4 M
php-cli x86_64 5.3.4-1.el5.remi remi 2.6 M
php-common x86_64 5.3.4-1.el5.remi remi 968 k
php-devel x86_64 5.3.4-1.el5.remi remi 622 k
php-mbstring x86_64 5.3.4-1.el5.remi remi 2.3 M
php-mysql x86_64 5.3.4-1.el5.remi remi 157 k
php-pdo x86_64 5.3.4-1.el5.remi remi 116 k
php-pear noarch 1:1.9.1-6.el5.remi remi 433 k
php-pear-Auth-SASL noarch 1.0.4-1.el5.remi remi 11 k
php-pear-File noarch 1.3.0-2.el5.remi remi 37 k
php-pear-HTTP-Request noarch 1.4.4-1.el5.remi remi 22 k
php-pear-Log noarch 1.12.4-1.el5.remi.1 remi 60 k
php-pear-MDB2 noarch 2.4.1-2.el5.centos extras 132 k
php-pear-MDB2-Driver-mysql noarch 1.4.1-3.el5.centos extras 41 k
php-pear-Mail noarch 1.2.0-1.el5.remi remi 29 k
php-pear-Mail-Mime noarch 1.8.1-1.el5.remi remi 42 k
php-pear-Net-SMTP noarch 1.4.4-1.el5.remi remi 19 k
php-pear-Net-Sieve noarch 1.3.0-1.el5.remi remi 20 k
php-pear-Net-Socket noarch 1.0.10-1.el5.remi remi 11 k
php-pear-Net-URL noarch 1.0.15-1.el5.centos extras 9.7 k
php-pear-db noarch 1.7.13-2.el5.rf rpmforge 139 k
php-tidy x86_64 5.3.4-1.el5.remi remi 51 k
Installing for dependencies:
libedit x86_64 20090923-3.0_1.el5.rf rpmforge 272 k
mysql-libs x86_64 5.1.53-1.el5.remi remi 1.7 M
mysqlclient15 x86_64 5.0.67-1.el5.remi remi 1.3 M
Transaction Summary
==================================================================================================================================================================================================================
Install 30 Package(s)
Upgrade 0 Package(s)
Total download size: 31 M
Is this ok [y/N]: y
Downloading Packages:
(1/30): php-pear-Net-URL-1.0.15-1.el5.centos.noarch.rpm | 9.7 kB 00:00
(2/30): php-pear-Net-Socket-1.0.10-1.el5.remi.noarch.rpm | 11 kB 00:00
(3/30): php-pear-Auth-SASL-1.0.4-1.el5.remi.noarch.rpm | 11 kB 00:00
(4/30): php-pear-Net-SMTP-1.4.4-1.el5.remi.noarch.rpm | 19 kB 00:00
(5/30): php-pear-Net-Sieve-1.3.0-1.el5.remi.noarch.rpm | 20 kB 00:00
(6/30): php-pear-HTTP-Request-1.4.4-1.el5.remi.noarch.rpm | 22 kB 00:00
(7/30): php-pear-Mail-1.2.0-1.el5.remi.noarch.rpm | 29 kB 00:00
(8/30): php-pear-File-1.3.0-2.el5.remi.noarch.rpm | 37 kB 00:00
(9/30): php-pear-MDB2-Driver-mysql-1.4.1-3.el5.centos.noarch.rpm | 41 kB 00:00
(10/30): php-pear-Mail-Mime-1.8.1-1.el5.remi.noarch.rpm | 42 kB 00:00
(11/30): php-tidy-5.3.4-1.el5.remi.x86_64.rpm | 51 kB 00:00
(12/30): php-pear-Log-1.12.4-1.el5.remi.1.noarch.rpm | 60 kB 00:00
(13/30): php-pdo-5.3.4-1.el5.remi.x86_64.rpm | 116 kB 00:01
(14/30): php-pear-MDB2-2.4.1-2.el5.centos.noarch.rpm | 132 kB 00:00
(15/30): php-pear-db-1.7.13-2.el5.rf.noarch.rpm | 139 kB 00:01
(16/30): perl-DBD-MySQL-3.0007-2.el5.x86_64.rpm | 148 kB 00:00
(17/30): php-mysql-5.3.4-1.el5.remi.x86_64.rpm | 157 kB 00:01
(18/30): libedit-20090923-3.0_1.el5.rf.x86_64.rpm | 272 kB 00:02
(19/30): php-pear-1.9.1-6.el5.remi.noarch.rpm | 433 kB 00:02
(20/30): php-devel-5.3.4-1.el5.remi.x86_64.rpm | 622 kB 00:02
(21/30): php-common-5.3.4-1.el5.remi.x86_64.rpm | 968 kB 00:03
(22/30): mysql-5.1.53-1.el5.remi.x86_64.rpm | 1.1 MB 00:03
(23/30): mysqlclient15-5.0.67-1.el5.remi.x86_64.rpm | 1.3 MB 00:03
(24/30): php-5.3.4-1.el5.remi.x86_64.rpm | 1.4 MB 00:03
(25/30): dovecot-1.0.7-7.el5.x86_64.rpm | 1.7 MB 00:00
(26/30): mysql-libs-5.1.53-1.el5.remi.x86_64.rpm | 1.7 MB 00:04
(27/30): php-mbstring-5.3.4-1.el5.remi.x86_64.rpm | 2.3 MB 00:04
(28/30): php-cli-5.3.4-1.el5.remi.x86_64.rpm | 2.6 MB 00:04
(29/30): mysql-5.0.77-4.el5_5.4.i386.rpm | 4.8 MB 00:00
(30/30): mysql-server-5.1.53-1.el5.remi.x86_64.rpm | 11 MB 00:09
——————————————————————————————————————————————————————————————————————
Total 464 kB/s | 31 MB 01:07
警告: rpmts_HdrFromFdno: ヘッダ V3 DSA signature: NOKEY, key ID 00f97f56
remi/gpgkey | 1.3 kB 00:00
Importing GPG key 0x00F97F56 “Remi Collet <RPMS@FamilleCollet.com>” from /etc/pki/rpm-gpg/RPM-GPG-KEY-remi
Is this ok [y/N]:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
WARNING : This php-* RPM are not official Fedora/Redhat build and
overrides the official ones. Don’t file bugs on Fedora Project nor Redhat.
Use dedicated forums http://forums.famillecollet.com/
Installing : php-common 1/30
WARNING : This MySQL RPM is not an official Fedora/Redhat build and it
overrides the official one. Don’t file bugs on Fedora Project nor Redhat.
Use dedicated forums http://forums.famillecollet.com/
Installing : mysql-libs 2/30
Installing : mysqlclient15 3/30
Installing : perl-DBD-MySQL 4/30
Installing : mysql 5/30
Installing : php-mbstring 6/30
Installing : php-pdo 7/30
Installing : libedit 8/30
Installing : php-cli 9/30
Installing : php 10/30
Installing : php-mysql 11/30
Installing : mysql-server 12/30
Installing : dovecot 13/30
Installing : php-tidy 14/30
Installing : mysql 15/30
Installing : php-pear 16/30
Installing : php-pear-Net-Socket 17/30
Installing : php-pear-MDB2 18/30
Installing : php-pear-Auth-SASL 19/30
Installing : php-pear-Net-SMTP 20/30
Installing : php-pear-Mail 21/30
Installing : php-pear-Net-URL 22/30
Installing : php-pear-db 23/30
Installing : php-pear-File 24/30
Installing : php-pear-Log 25/30
Installing : php-devel 26/30
Installing : php-pear-HTTP-Request 27/30
Installing : php-pear-Net-Sieve 28/30
Installing : php-pear-MDB2-Driver-mysql 29/30
Installing : php-pear-Mail-Mime 30/30
Installed:
dovecot.x86_64 0:1.0.7-7.el5 mysql.i386 0:5.0.77-4.el5_5.4 mysql.x86_64 0:5.1.53-1.el5.remi mysql-server.x86_64 0:5.1.53-1.el5.remi
perl-DBD-MySQL.x86_64 0:3.0007-2.el5 php.x86_64 0:5.3.4-1.el5.remi php-cli.x86_64 0:5.3.4-1.el5.remi php-common.x86_64 0:5.3.4-1.el5.remi
php-devel.x86_64 0:5.3.4-1.el5.remi php-mbstring.x86_64 0:5.3.4-1.el5.remi php-mysql.x86_64 0:5.3.4-1.el5.remi php-pdo.x86_64 0:5.3.4-1.el5.remi
php-pear.noarch 1:1.9.1-6.el5.remi php-pear-Auth-SASL.noarch 0:1.0.4-1.el5.remi php-pear-File.noarch 0:1.3.0-2.el5.remi php-pear-HTTP-Request.noarch 0:1.4.4-1.el5.remi
php-pear-Log.noarch 0:1.12.4-1.el5.remi.1 php-pear-MDB2.noarch 0:2.4.1-2.el5.centos php-pear-MDB2-Driver-mysql.noarch 0:1.4.1-3.el5.centos php-pear-Mail.noarch 0:1.2.0-1.el5.remi
php-pear-Mail-Mime.noarch 0:1.8.1-1.el5.remi php-pear-Net-SMTP.noarch 0:1.4.4-1.el5.remi php-pear-Net-Sieve.noarch 0:1.3.0-1.el5.remi php-pear-Net-Socket.noarch 0:1.0.10-1.el5.remi
php-pear-Net-URL.noarch 0:1.0.15-1.el5.centos php-pear-db.noarch 0:1.7.13-2.el5.rf php-tidy.x86_64 0:5.3.4-1.el5.remi
Dependency Installed:
libedit.x86_64 0:20090923-3.0_1.el5.rf mysql-libs.x86_64 0:5.1.53-1.el5.remi mysqlclient15.x86_64 0:5.0.67-1.el5.remi
Complete!
[/shell]
これで完了。ひとまずPHPとMySQLのバージョンを確認してみる。
この時点ではまだWEB上で稼動しているPHPとMySQLには新バージョンは適用されていない。
[shell]
# php -v
PHP 5.3.4 (cli) (built: Dec 11 2010 18:28:50)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
# rpm -qa | grep php | sort
php-5.3.4-1.el5.remi
php-cli-5.3.4-1.el5.remi
php-common-5.3.4-1.el5.remi
php-devel-5.3.4-1.el5.remi
php-mbstring-5.3.4-1.el5.remi
php-mysql-5.3.4-1.el5.remi
php-pdo-5.3.4-1.el5.remi
php-pear-1.9.1-6.el5.remi
php-pear-Auth-SASL-1.0.4-1.el5.remi
php-pear-File-1.3.0-2.el5.remi
php-pear-HTTP-Request-1.4.4-1.el5.remi
php-pear-Log-1.12.4-1.el5.remi.1
php-pear-MDB2-2.4.1-2.el5.centos
php-pear-MDB2-Driver-mysql-1.4.1-3.el5.centos
php-pear-Mail-1.2.0-1.el5.remi
php-pear-Mail-Mime-1.8.1-1.el5.remi
php-pear-Net-SMTP-1.4.4-1.el5.remi
php-pear-Net-Sieve-1.3.0-1.el5.remi
php-pear-Net-Socket-1.0.10-1.el5.remi
php-pear-Net-URL-1.0.15-1.el5.centos
php-pear-db-1.7.13-2.el5.rf
php-tidy-5.3.4-1.el5.remi
# mysql –version
mysql Ver 14.14 Distrib 5.1.53, for redhat-linux-gnu (x86_64) using readline 5.1
# rpm -qa | grep mysql | sort
mysql-5.0.77-4.el5_5.4
mysql-5.1.53-1.el5.remi
mysql-libs-5.1.53-1.el5.remi
mysql-server-5.1.53-1.el5.remi
mysqlclient15-5.0.67-1.el5.remi
php-mysql-5.3.4-1.el5.remi
php-pear-MDB2-Driver-mysql-1.4.1-3.el5.centos
[/shell]
例によってphp.iniを編集します。
[shell]
$ cp /etc/php.ini /etc/php.ini.rpmnew
$ vi /etc/php.ini
[/shell]
[shell]
;; Disable Output Buffering
output_buffering = Off
;; Set HTTP header charset
; default_charset = EUC-JP
;; Set default language to Japanese
mbstring.language = Japanese
;; HTTP input encoding translation is enabled.
mbstring.encoding_translation = off
;; Set HTTP input encoding conversion to auto
mbstring.http_input = pass
;; Convert HTTP output to EUC-JP
mbstring.http_output = pass
;; Set internal encoding to EUC-JP
mbstring.internal_encoding = EUC-JP
;; Do not print invalid characters
mbstring.substitute_character = none
mbstring.detect_order = SJIS,EUC-JP,JIS,UTF-8,ASCII
date.timezone =”Asia/Tokyo”
[/shell]
その他、こまごま修正。
保存して、Apacheを再起動。
[shell]
# /etc/init.d/httpd restart
httpd を停止中: [ OK ]
httpd を起動中: [Mon Dec 13 04:05:29 2010] [warn] module php5_module is already loaded, skipping
[ OK ]
[/shell]

再起動後に、phpinfoで確認すると、しっかりとバージョンが反映されていることが確認できました。
Wordpress 3.03にも今のところ影響ゼロ。
次回はSymfonyをインストールしてみましょう。

参考サイト:
【CentOS 5.5にPHP 5.3.3とMySQL 5.1.51を入れる】
http://d.hatena.ne.jp/water-moon/20101102/1288691756

【PHPの文字化けを本気で解決する】
http://hain.jp/index.php/tech-j/2007/02/13/%EF%BC%B0%EF%BC%A8%EF%BC%B0%E3%81%AE%E6%96%87%E5%AD%97%E5%8C%96%E3%81%91