windows下安装PEAR, PHPUnit

本文详细介绍如何在Windows环境下安装PEAR及其相关配置步骤,并进一步介绍如何通过PEAR安装PHPUnit,包括环境变量设置、通道添加及依赖更新等内容。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、Windows的开始 -> 运行 ->cmd

2、安装命令

   进入php所在目录,执行命令:go-pear.bat

 Are you installing a system-wide PEAR or a local copy?
(system|local) [system] : 敲击回车键 (Enter)

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)                   : D:\APMServ5.2.6\PHP
 2. Temporary directory for processing            : D:\APMServ5.2.6\PHP\tmp
 3. Temporary directory for downloads             : D:\APMServ5.2.6\PHP\tmp
 4. Binaries directory                            : D:\APMServ5.2.6\PHP
 5. PHP code directory ($php_dir)                 : D:\APMServ5.2.6\PHP\pear
 6. Documentation directory                       : D:\APMServ5.2.6\PHP\docs
 7. Data directory                                : D:\APMServ5.2.6\PHP\data
 8. User-modifiable configuration files directory : D:\APMServ5.2.6\PHP\cfg
 9. Public Web Files directory                    : D:\APMServ5.2.6\PHP\www
10. Tests directory                               : D:\APMServ5.2.6\PHP\tests
11. Name of configuration file                    : D:\APMServ5.2.6\PHP\pear.ini

12. Path to CLI php.exe                           : D:\APMServ5.2.6\PHP\.

1-12, ‘all’ or Enter to continue:  输入all

接下来一直回车,最后

PHP 目录会多出一个文件 PEAR_ENV.reg ,双击导入注册表。

输入pear version,显示:

PEAR Version: 1.9.4
PHP Version: 5.3.5
Zend Engine Version: 2.3.0
Running on: Windows NT CND0135 5.1 build 2600 (Windows XP Professional Service Pack 3) i586

表示pear已安装成功。

安装PHPUnit之前,要把pear的路径添加到php.ini中

include_path=".;E:\wamp\bin\php\php5.3.5\PEAR"

接着要添加Channel

pear channel-discover pear.phpunit.de

pear channel-discover components.ez.no

pear channel-discover pear.symfony-project.com

然后,pear upgrade-all命令对pear进行升级,因为phpunit的安装对pear的版本有要求。

最后,pear install phpunit/PHPUnit安装phpunit。

安装失败要重新安装时,先执行pear clear-cache命令再安装。

转载于:https://www.cnblogs.com/linzhenjie/archive/2012/10/10/2719216.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值