Dreamhost で PEAR ローカルコピーを作る

Date
2006-03-18 (Sat)
Category
php

前のエントリの続きです。)PEAR のローカルコピー、つまり展開先を指定して PEAR のファイルをとってくる方法を解説します。Dreamhost と唱っていますが、Terminal アクセス(ssh)のあるレンタルホストならどこでも同じように出来ると思います。

前々から、何処かで記事を書いた気がする、と思っていたけれど、この blog 内には見当たらないし。ま、実際書くほども無い位簡単ではある。しかし、今回、この サイトのある dreamhost で試してみたら…

> pear -s -c ~/.pearrc -d doc_dir=~/pear/docs -d ext_dir=~/pear/ext \
       -d php_dir=~/pear/lib -d data_dir=~/pear/data -d test_dir=~/pear/tests \
       -d cache_dir=~/pear/cache -d bin_dir=~/pear/bin
> pear -c ~/.pearrc install Archive_Tar
WARNING: channel "pear.php.net" has updated its protocols, use "channel-update pear.php.net" to update
Cannot install, php_dir for channel "pear.php.net" is not writeable by the current user

と出てうまく行かない…ググって見つけたのが此のサイト。

さくらサーバで PEAR を自由に使いたい場合

…此れ書いたの自分じゃん。。(微妙に間違ったことも書いてる気がするが、まぁいいや。)

どっちにしても、共有ホストにおける PEAR のローカルコピーのインストール をリンクしていて同じようにやれ、と書いてある。

それで僕がしたのは、まず

> pear -c ~/.pearrc channel-update pear.php.net
Retrieving channel.xml from remote server
Registry directory is not writeable by the current user

やっぱりダメらしい。

> wget http://pear.php.net/channel.xml

として、channel.xml をダウンロードして、~/pear/ に置いても無駄。さぁて。こう言うときは英語文献に当たるのがイイかも。というわけですぐ発見。

Installation of a local PEAR copy on a shared host

…要するに、日本語版の翻訳が古くて実情に合ってないわけです。やってみましょう。

> pear config-create /home/user/pear .pearrc
Configuration (channel pear.php.net):
=====================================
Auto-discover new Channels     auto_discover    
Default Channel                default_channel  pear.php.net
HTTP Proxy Server Address      http_proxy       
PEAR server [DEPRECATED]       master_server    
Default Channel Mirror         preferred_mirror 
Remote Configuration File      remote_config    
PEAR executables directory     bin_dir          ~/pear/pear
PEAR documentation directory   doc_dir          ~/pear/pear/docs
PHP extension directory        ext_dir          ~/pear/pear/ext
PEAR directory                 php_dir          ~/pear/pear/php
PEAR Installer cache directory cache_dir        ~/pear/pear/cache
PEAR data directory            data_dir         ~/pear/pear/data
PHP CLI/CGI binary             php_bin          
PEAR test directory            test_dir         ~/pear/pear/tests
Cache TimeToLive               cache_ttl        
Preferred Package State        preferred_state  
Unix file mask                 umask            
Debug Log Level                verbose          
PEAR password (for             password         
maintainers)
Signature Handling Program     sig_bin          
Signature Key Directory        sig_keydir       
Signature Key Id               sig_keyid        
Package Signature Type         sig_type         
PEAR username (for             username         
maintainers)
User Configuration File        Filename         ~/.pearrc
System Configuration File      Filename         #no#system#config#
Successfully created default configuration file "~/.pearrc"

うまく行ったっぽい。日本語版にも、英語版にもマニュアルに書いて無いですが、pear config-create して出るメッセージによると、bin_dir は ~/pear/pear に出来ている様なので .cshrc に以下を書き加えます。(Dreamhost は Linux ですが、tcsh がデフォルトシェルっぽい。もし bash を使ってるなら .bashrc に pear マニュアルに書いてある通りすること)参照: .cshrcのカスタマイズ

set path=($HOME/pear)

そして rehash して、

> mkdir pear
> chmod 766 pear
> pear install -o PEAR

とすると、PEAR, Archive_Tar, Console_Getopt が入ります。せっかくなので、XML_RPC も入れときましょうか。

> pear install XML_RPC

此れ以降、Terminal で pear とすると、このローカルコピーにファイルが追加されます。

あと dreamhost では php.ini を(自前ビルドしない限り)個別に用意するのはできないみたいなんで、以下を各スクリプトに追加?マジですか。。。

$old_ini = ini_get('include_path');
ini_set('include_path', $old_ini.':/PATH/TO/HOME/pear/pear/php');

ふぅむ。

Comment:9

DreamHostのカタチ:2006-06-14 (Wed) 06:11

DreamhostでのPHP.iniですが、cgi-binフォルダを作ってその中に入れると有効になりました。不思議な仕様ですね。
http://iisaba.com/freshreader.html

tksh:2006-06-19 (Mon) 01:11

> DreamHostのカタチ さん
GJ!情報ありがとうございます。これで私家版 pear とか使いまくれます。今、興味があるのは、MTASC(Flash compiler のフリー実装)で有名な Motion Twin という France のチームが作ってる、PHP TAL というのがあって、彼らは Pear を package manager に採用しているんですよね。これも記事にまとめたい。

Rift Platinum:2011-09-19 (Mon) 03:13

training aircraft watches breitling replica fly ball and many other features chronograph DLC MMD modern DLC .

moncler vest:2011-12-12 (Mon) 07:31

It is always a pleasure doing business with you.

louis vuitton outlet:2011-12-14 (Wed) 01:31

New style louis vuitton outlet are all come with our online store,
100% authentic and 100% Satisfaction 2011 louis vuitton bags are accumulation cheapest price.
High quality guarantee with amazing low price from our louis vuitton outlet store online,
Come and just enjoy shopping here, what you see will the same as what you get,
buy cheap louis vuitton online now!

hermes birkin handbags :2012-01-16 (Mon) 04:47

ho want to enjoy the luxury of owning a genuine Louis Vuitton bag without the genuine price.
Discount Louis Vuitton Handbags can be found online for prices that you would never believe you could pay. You can buy authentic discount Louis Vuitton Handbags on the Internet for affordable prices. Prices as low as $100. Louis Vuitton handbags usually start at around $595.00 and can go

hermes kelly:2012-01-16 (Mon) 04:48

up to over $4000.00 retail. There are bags that are seasonal or specially made that go into the 5 digit numbers. Have you heard about the Louis Vuitton Tribute Patchwork? This handbag retails

chanel handbags:2012-01-16 (Mon) 04:49

That is where the discounted Louis Vuitton handbag comes in to play. There are authentic handbags that are being sold for wholesale prices on certain sites. You can find fabulous cheap Louis Vuitton handbags for sale on live auction sites that allow you to bid on these bags for

EPI leather:2012-01-16 (Mon) 04:51

fractions of the retail prices. For the prices that you would see on the LV website or eluxury.com, you are getting a bargain on authentic Louis Vuitton handbags online.
Once you think of how much Louise Vuitton handbags are being sold for in retail shops, the thought of just spending a few hundred seems so easy to do for most. Imagine for a moment the

Comment Form

Remember Me?


Trackback:1

TrackBack URL for this entry
http://blogs.grf-design.com/mt/mt-tb.cgi/155
Listed below are links to weblogs that reference
Dreamhost で PEAR ローカルコピーを作る from The Croton
[php][pear]XREAでPEARをインストールするのにハマッタときのメモ from Kemworld::Diary : 2007-10-03 (Wed) 12:04
携帯サイトを作るにあたり、PEARのNet_UserAgent_Mobileが使いたいなと思い、XREAにPEARをインストールしようとしたところでおお...

Return to Page Top