それ、メッセージ花火でわざわざ伝えること?

PHP5環境下でPEARモジュールをインストールしましたが、実行時にモジュールがないというエラーメッセージが表示され、対応をしています。
お助けください。

1.現象
 PHP5のプログラム実行時にエラーとなってしまい、下記のメッセージが表示されました。

Warning: require_once(Cache/Lite.php) [function.require-once]: failed to open stream: No such file or directory in ・・・

Fatal error: require_once() [function.require]: Failed opening required 'Cache/Lite.php' (include_path='.:/home/example/share/pear5') in ・・・

2.環境
 ・さくらインターネット(FreeBSD)でPHP5を独自にインストールしPEARライブラリも導入済です。

   PHP5実行ファイルのインストール先 /home/example/www/cgi-bin

 ・phpinfo()で確認した、include_pathは下記の通りです。

   .:/home/example/share/pear5

 ・pear config-show で確認した結果は、下記の通りです。

   pear config-set bin_dir /home/example/share/pear5/bin
   pear config-set doc_dir /home/example/share/pear5/PEAR/docs
   pear config-set ext_dir /home/example/share/pear5/PEAR/extensions
   pear config-set php_dir /home/example/share/pear5/PEAR
   pear config-set cache_dir /home/example/share/pear5/PEAR/cache
   pear config-set data_dir /home/example/share/pear5/PEAR/data
   pear config-set php_bin /home/example/www/cgi-bin
   pear config-set test_dir /home/example/share/pear5/PEAR/tests
   pear config-set download_dir /home/example/share/pear5/temp/download
   pear config-set temp_dir /home/example/share/pear5/temp


 ・pear list で確認した結果は、下記の通りです。

   Archive_Tar 1.3.2 stable
   Cache_Lite 1.7.2 stable
   Console_Getopt 1.2.2 stable
   HTML_Templete_IT 1.2.1 stable
   Net_UserAgent_Detect 2.2.0 stable
   PEAR 1.5.1 stable
   PEAR_Frontend_Web 0.5.1 alpha
   Structures_Graph 1.0.2 stable

・Cache_Liteの所在
    /home/example/share/pear5 の中で、Cache_Lite らしきモジュールを
    探してみたところ、下記のディレクトリにありました。
   
     /home/example/share/pear5/PEAR/Cache
       Lite.php
     /home/example/share/pear5/PEAR/Cache/Lite
       File.php
       Function.php
       Output.php
     /home/example/share/pear5/PEAR/tests/Cache_Lite/tests
       拡張子.phptのファイルが多数


  ・PEARおよび、モジュールのインストールは下記のサイトを参照して実行しています。

   http://zenryokuhp.com/server/sakura_pear.htm


3.疑問点
  ・モジュールは、include_pathで指定されている、
     /home/example/share/pear5
   の直下に置かなければならないのでしょうか。

  ・現在、モジュールは /home/example/share/pear5/PEAR に存在しているのですが、
   include_pathで指定した位置よりも、1階層下に置いてはいけないのでしょうか。

  ・再度、PHP5とPEARのインストールをやり直し、pear config-set コマンドにて、

     pear config-set php_dir /home/example/share/pear5/

   と設定し、モジュール"Cache_Lite"をインストールしようとしましたが、

     "Cannot install, php_dir for channel "pear.php.net" is not writeable the current user"

   と表示されて、インストールが出来ませんでした。
   /home/example/share/pear5/ ではインストール出来ず、
   /home/example/share/pear5/PEAR ではインストール出来るというのは、
   PHP5をインストールしたときに同時に登録されるPEARのディレクトリには
   インストール出来ないということなのでしょうか。


以上、ご教授をお願いいたします。

A 回答 (2件)

>  ・モジュールは、include_pathで指定されている、


>     /home/example/share/pear5
>   の直下に置かなければならないのでしょうか。

include_path に合わせてモジュールを置かねばならない、というよりは
モジュールを置いた場所に合わせて include_path を適切に書かねばならない、
という方が正確なところであろうと思います。

モジュールを置く場所については特に制限がないけれど、
置いた場所を include_path で正しく指定しておく、ということでありましょう。

【例】
/home/php/pear/ の直下に Cache/Lite.php があるのであれば、
include_path には /home/php/pear/ を書いておき、
スクリプトでは
require_once 'Cache/Lite.php'
のように書けばよいと思います。
    • good
    • 0

>(include_path='.:/home/example/share/pear5')


このような環境で
/home/example/share/pear5/PEAR/Cache
Lite.php
これがあるのなら、
require 'PEAR/Cache/Lite.php'
ではないでしょうか。

>/home/example/share/pear5/ ではインストール出来ず、
/home/example/share/pear5/PEAR ではインストール出来るというのは、

ここはちょっとわからないですが、pear5/に書き込み権限はありますか?

この回答への補足

モジュールを、/home/example/share/pear5/PEAR の直下にインストールした状態で、
 require 'PEAR/Cache/Lite.php'
で実行できるようになりました。

/home/example/share/pear5/ も、
/home/example/share/pear5/PEAR も、パーミッションは"755"なので、
/home/example/share/pear5/ に書き込みが出来ないということはないと思っているのですが、
なぜか書き込みができないんです。

補足日時:2007/03/17 11:26
    • good
    • 0

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!