PEARの再設定時に **ERROR**

技術関係

PCの環境を変えた後に、PEARを使ってライブラリのインストールをしようとすると以下のようなエラーが出て怒られた

||
% pear
PHP_PEAR_INSTALL_DIR is not set correctly.
Please fix it using your environment variable or modify
the default value in pear.bat
The current value is:
ディレクトリのパス
||<

仕方なしに、PEARを再設定しようとすると以下のようなエラーが出て先に進まない状態に

||
% go-pear.bat
(中略)
ERROR: not a folder, or no php.exe found in this folder.
Press Enter to continuh…

Below is a suggested file layout for your new PEAR installation. To
change individual locations, type the number in front of the
directory. Type ‘all’ to change all of them or simply press Enter to
accept these locations.

  1. Installation base ($prefix) : I:\php
  2. Temporary directory for processing : I:\php\tmp
  3. Temporary directory for downloads : I:\php\tmp
  4. Binaries directory : I:\php
  5. PHP code directory ($php_dir) : I:\php\pear
  6. Documentation directory : I:\php\docs
  7. Data directory : I:\php\data
  8. User-modifiable configuration files directory : I:\php\cfg
  9. Public Web Files directory : I:\php\www
  10. Tests directory : I:\php\tests
  11. Name of configuration file : I:\php\pear.ini
  12. Path to CLI php.exe :

1-12, ‘all’ or Enter to continue: 12 I\php\php.exe
||<

どうやらPHPとPEARを設定後にインストールされたディレクトリをごちゃごちゃと入れ替えたのが原因らしい。

ので、すでに作成されていたpear.batの中身を以下のように修正すると無事再設定可能になりました。

||
@ECHO OFF
set PHP_BIN=(PHPのインストールディレクトリ)\php.exe
%PHP_BIN% -d output_buffering=0 PEAR\go-pear.phar
pause
||<

タイトルとURLをコピーしました