wamp下phpunit亲自安装

运行wamp/bin/php/php5.2.6/go-pear.bat批处理文件,一路回车确认,安装完成。

根据提示,双击wamp/bin/php/php5.2.6/目录下,新生成的PEAR_ENV.reg注册表文件,将环境配置参数导入系统注册表。

 

PHPUnit安装

pear channel-discover  pear.phpunit.de(该命令是初始化pear的下载地址)

 

可能中间还会出现某些channel找不到的错误

那么,可以添加如下channel

pear channel-discover components.ez.no
pear channel-discover pear.phpunit.de
pear channel-discover pear.symfony-project.com

 

 

接下来

pear install phpunit/PHPUnit(该命令是安装phpunit包下的PHPUnit)

 

 

 

注意:在这里会出现问题,这个包可能依赖的其他包没有安装,因此要把他所依赖的包都下载下来,看下面的命令:

pear install --alldeps phpunit/PHPUnit

 

 

如此,便可将所有依赖的包都下载并且安装。

其实,要安装PHPUnit是需要pear installer 1.9.2版本的。如果你的这个installer低于这个版本 安装则不成功。

解决方法:首先更新pear installer。运行命令:pear upgrade PEAR即可更新到最新版本。

然后再运行 pear install phpunit/PHPUnit命令,这样PHPUnit安装结束。

 

 

-----------------------------------------------------------------------------------------------------

这个可是理想的安装啊

本人在安装的时候,出现了这样的curl扩展没有开启,同时XML_RPC2组件没有提前安装的错误。找遍整个互联网,就知道有这个组件存在,却没有相关单独安装这个组件的帮助。

最后,在pear.net网站上找到了通过svn打包源文件后,利用pear打包,并安装的办法

 

http://svn.php.net/repository/pear/packages/XXXX_package/trunk     这是组件svn地址,把中间的XXXX_package替换成你需要的包的名字即可。

svn检出后,导出文件。放到php.exe所在的文件夹。

pear package <path to package.xml>  打包成安装文件

pear install <package-file> 安装

 

原安装帮助文件地址   http://pear.php.net/manual/en/guide.users.commandline.installing.php

 

Installing packages from SVN

This passage will describe how to install the latest development version of a PEAR package from SVN.

It is NOT recommended to run a package from SVN in working environments! Because SVN versions are not regular releases, this means:

  • You could get no kind of help from the maintainer or anybody other.

  • Versions in SVN may break the upgrade mechanism of the PEAR Installer.

 

You should use a package from SVN only, if:

  • The maintainer recommended it for you.

  • You want to help in development of a package.

  • You really need a special patch or function, which is not currently released.

 

If you still want to install a package from SVN, you have to do the same steps like a package maintainer creating a new release of a package. If you have problems following the next steps, take a look into the Developers Section of the manual.

  1. Get the package files from SVN like described in http://www.php.net/svn.php

    The name of the module to checkout is pear/<packagename>/trunk, i.e. svn checkout http://svn.php.net/repository/pear/packages/HTTP_Client/trunk HTTP_Client.

  2. Check the package.xml file, especially the dir and file entries. They must match the existing files and directory structure. If they differ, contact the package maintainer and ask for an update of the package.xml.

  3. Create a valid package using the PEAR Installer pear package <path to package.xml>

  4. If you have already installed the package: remove it to avoid version conflicts: pear uninstall <package>

  5. Install your package archive: pear install <package-file>

    Now, you have a SVN version installed!

You should upgrade to an official release of the package as early as possible. Before you install the official release, uninstall the SVN version to avoid version conflicts.

 

 

至此,安装 提示,一个一个关联组件都安装好之后,pear install phpunit/PHPUnit    ,哈哈,终于搞定

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值