PHP バージョンアップ
PHP 5.2.14 から PHP 5.3.6 へバージョンアップ。
以下3つのパッケージがインストールされている状態からバージョンアップ。
PHP 5.2.14
APC 3.1.9
memcache 2.2.6
PHP 5.3.6 を普通に configure して make して make install。
これだけだと php -v のコマンドでphpのバージョンを確認しようとすると
以下のようなエラーが出てしまう。
PHP Warning: PHP Startup: apc: Unable to initialize module
Module compiled with module API=20060613
PHP compiled with module API=20090626
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: memcache: Unable to initialize module
Module compiled with module API=20060613
PHP compiled with module API=20090626
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: mysql: Unable to initialize module
Module compiled with module API=20060613
PHP compiled with module API=20090626
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: pdo_mysql: Unable to initialize module
Module compiled with module API=20060613
PHP compiled with module API=20090626
These options need to match
in Unknown on line 0
PHP 5.3.6 (cli) (built: Jun 13 2011 21:39:35)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
このエラーの原因は
php.iniに記載されている、 extension_dir のパスが違っていたから でした。
php 5.2.14 の時は /usr/local/lib/php/extensions/no-debug-non-zts-20060613
このままだとエラーが出てしまうので以下のように修正した。
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20090626"
APCとmemcacheは PECLを使用して アンインストール、インストールすれば良い。
*1
*1:と、思う。この辺り削除したりインストールしたりを繰り返していたので正しい手順が分からない