c/fe

http://d.hatena.ne.jp/uzulla から移行しました。

PHP5.2.10でpearがおかしい

新しくサーバーをセットアップしていたら、5.2.10だとpearがうまくインストールできなかった。
make install時もエラーがでておかしいなって思っていたが、pearを叩くと

[root@localhost ~]# pear upgrade

Notice: Undefined variable: dorest in PEAR/Command/Install.php on line 1220
PHP Notice: Undefined variable: dorest in /usr/local/lib/php/PEAR/Command/Install.php on line 1220

Notice: Undefined variable: latest in PEAR/Command/Install.php on line 1228
PHP Notice: Undefined variable: latest in /usr/local/lib/php/PEAR/Command/Install.php on line 1228

Notice: Undefined variable: latest in PEAR/Command/Install.php on line 1234
PHP Notice: Undefined variable: latest in /usr/local/lib/php/PEAR/Command/Install.php on line 1234

Warning: array_change_key_case(): The argument should be an array in PEAR/Command/Install.php on line 1234
PHP Warning: array_change_key_case(): The argument should be an array in /usr/local/lib/php/PEAR/Command/Install.php on line 1234
Nothing to upgrade

こんなエラーがでたり。


オチからいえば、channelの設定ファイルがおかしかったらしく?
http://www.pear-forum.org/post-5065.html
を参考にして、別のサーバーの5.2.9のコンフィグファイルをコピペしたらうごいた。


2009/08/08 追記
コメント欄で教えてもらいました。

Kwokfu: Just remove the ".channels" directory and do a "pear update-channels" should solve your problem.

との事です。
保存されてるチャンネルリストを一回全部消して、再取得すればいいんですね。
削除しないとダメなのしらなかった…。

thanks to Kwokfu!



(以下古いメモ)

以下の感じ

[root@localhost .channels]# pwd
/usr/local/lib/php/.channels
[root@localhost .channels]# cat pear.php.net.reg
a:5:{s:4:"name";s:12:"pear.php.net";s:14:"suggestedalias";s:4:"pear";s:7:"summary";s:40:"PHP Extension and Application Repository";s:7:"servers";a:1:{s:7:"primary";a:2:{s:6:"xmlrpc";a:1:{s:8:"function";a:10:{i:0;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:9:"logintest";}i:1;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:26:"package.listLatestReleases";}i:2;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:15:"package.listAll";}i:3;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:12:"package.info";}i:4;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:22:"package.getDownloadURL";}i:5;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.1";}s:8:"_content";s:22:"package.getDownloadURL";}i:6;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:25:"package.getDepDownloadURL";}i:7;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.1";}s:8:"_content";s:25:"package.getDepDownloadURL";}i:8;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:14:"package.search";}i:9;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:15:"channel.listAll";}}}s:4:"rest";a:1:{s:7:"baseurl";a:2:{i:0;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.0";}s:8:"_content";s:25:"http://pear.php.net/rest/";}i:1;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.1";}s:8:"_content";s:25:"http://pear.php.net/rest/";}}}}}s:13:"_lastmodified";s:31:"Sat, 06 Jun 2009 00:42:24 +0900";}
[root@localhost .channels]# cat pecl.php.net.reg
a:6:{s:4:"name";s:12:"pecl.php.net";s:14:"suggestedalias";s:4:"pecl";s:7:"summary";s:31:"PHP Extension Community Library";s:7:"servers";a:1:{s:7:"primary";a:2:{s:6:"xmlrpc";a:1:{s:8:"function";a:10:{i:0;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:9:"logintest";}i:1;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:26:"package.listLatestReleases";}i:2;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:15:"package.listAll";}i:3;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:12:"package.info";}i:4;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:22:"package.getDownloadURL";}i:5;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.1";}s:8:"_content";s:22:"package.getDownloadURL";}i:6;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:25:"package.getDepDownloadURL";}i:7;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.1";}s:8:"_content";s:25:"package.getDepDownloadURL";}i:8;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:14:"package.search";}i:9;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:15:"channel.listAll";}}}s:4:"rest";a:1:{s:7:"baseurl";a:2:{i:0;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.0";}s:8:"_content";s:25:"http://pecl.php.net/rest/";}i:1;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.1";}s:8:"_content";s:25:"http://pecl.php.net/rest/";}}}}}s:15:"validatepackage";a:2:{s:8:"_content";s:19:"PEAR_Validator_PECL";s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}}s:13:"_lastmodified";s:31:"Sat, 06 Jun 2009 00:42:24 +0900";}