WAMP Server下安装PEAR

来源:互联网 发布:丽晶软件股份 编辑:程序博客网 时间:2024/05/16 10:03

我的WampServer是2.4-x86,在bin目录未找到ggo-pear这个文件。

以下是我安装PEAR的步骤:

1.下一个go-pear.phar,并将go-pear放入C:\wamp\bin\php\php5.4.16\pear

2.在命令行下进入php目录C:\wamp\bin\php\php5.4.16,运行php -d phar.require_hash=0 PEAR/go-pear.phar

按提示一路安装

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)                   : C:\wamp\bin\php\php5.4.16
 2. Temporary directory for processing            : C:\wamp\bin\php\php5.4.16\tmp
 3. Temporary directory for downloads             : C:\wamp\bin\php\php5.4.16\tmp
 4. Binaries directory                            : C:\wamp\bin\php\php5.4.16
 5. PHP code directory ($php_dir)                 : C:\wamp\bin\php\php5.4.16\pear
 6. Documentation directory                       : C:\wamp\bin\php\php5.4.16\docs
 7. Data directory                                : C:\wamp\bin\php\php5.4.16\data
 8. User-modifiable configuration files directory : C:\wamp\bin\php\php5.4.16\cfg
 9. Public Web Files directory                    : C:\wamp\bin\php\php5.4.16\www
10. Tests directory                               : C:\wamp\bin\php\php5.4.16\tests
11. Name of configuration file                    : C:\wamp\bin\php\php5.3.10\pear.ini
12. Path to CLI php.exe                           :

1-12, 'all' or Enter to continue: 

可以使用回车使用它默认的,如果出现

**ERROR**
Please, enter the php.exe path.

只要自己加上php.exe所在目录即可。


3.在wamp中的php.ini(注意有两个这样的文件哦,在bin下的php和apache文件里)添加include_path

include_path = "C:\wamp\bin\php\php5.4.16\pear"

然后重启wamp,让改动生效。


* WINDOWS ENVIRONMENT VARIABLES *

For convenience, a REG file is available under C:\wamp\bin\php\php5.4.16PEAR_ENV
.reg .
This file creates ENV variables for the current user.
Double-click this file to add it to the current user registry

4.添加环境变量,按照提示只要双击那个文件即可。

至此,pear安装完毕,你可以在命令行下install了: )


如果出现以下错误,请参考我的另一篇博文:http://blog.csdn.net/ibaicai2/article/details/14448117

C:\wamp\bin\php\php5.4.16>pear.bat
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:
C:\wamp\bin\php\php5.3.10\pear





原创粉丝点击