1

我在win7x64上的wamp2.1(Apache2.2.17,PHP5.3.5 MSVC6x32)上安装pear都是为了安装PHPUnit,一切顺利,但是当我执行

pear config-show

我得到一个意外的输出

特殊目录和我安装时设置的不一样,这正常吗?

C:\wamp21\bin\php\php5.3.5\PEAR>pear config-show
CONFIGURATION (CHANNEL PEAR.PHP.NET):
=====================================
PEAR executables directory     bin_dir          C:\wamp21\bin\php\php5.3.5\PEAR
PEAR documentation directory   doc_dir          C:\php\pear\docs
PHP extension directory        ext_dir          c:/wamp21/bin/php/php5.3.5/ext/
PEAR directory                 php_dir          C:\wamp21\bin\php\php5.3.5\PEAR\pear
PEAR configuration file        cfg_dir          C:\php\pear\cfg
directory
PEAR data directory            data_dir         C:\php\pear\data
.....

这是 pear cli 安装的摘录:

C:\wamp21\bin\php\php5.3.5\PEAR>php -d phar.require_hash=0 go-pear.phar

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

我会在 C:\wamp21\bin\php\php5.3.5\PEAR 中安装 pear 但现在我有两个目录数据,文档,测试

C:\php\梨\数据

C:\php\pear\docs

C:\php\梨\测试

C:\wamp21\bin\php\php5.3.5\PEAR\data

C:\wamp21\bin\php\php5.3.5\PEAR\docs

C:\wamp21\bin\php\php5.3.5\PEAR\tests

和他们的子目录

一个相关问题Installing pear on windows, wrong paths similar question

4

2 回答 2

0

可能是您未使用存储安装设置的 PEAR 配置文件。您可以通过使用以下-c选项手动指定它来修复它:

$ pear -c /path/to/config/file config-show

或者只是将其移动到当前显示的位置pear config-show

于 2013-03-27T12:18:22.003 回答
0

设置PHP_PEAR_SYSCONF_DIR为您所在的目录pear.ini

SETX PHP_PEAR_SYSCONF_DIR C:\wamp21\bin\php\php5.3.5\PEAR /M
于 2015-05-20T18:31:05.030 回答