安装phpunit

时间:2023-03-08 22:24:36

按照网上的提示,将go-pear.phar和phpunit.phar都放到php.exe所在的目录。但是以管理员身份运行时,输入命令php PEAR/go-pear.phar或php -d phar.require_hash=0 PEAR/go-pear.phar在我的win7下总是遇到这个问题:

Could not open input file: PEAR/go-pear.phar;

安装phpunit

这应该是命令的原因,注意对比这个出错时的命令和下面执行正确的命令对比。不过同时我也试了下面的办---打开windows目录下的php.ini文件,然后查找到如下的地方:
; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
; Windows: "\path1;\path2"
;include_path = ".;c:\php\includes"
把最后一行的注释去掉,然后把后面路径改成你的PEAR路径,例如:
include_path = ".;D:\PHPnow\php-5.2.6-Win32\PEAR"
保存PHP.INI,然后重新启动APACHE即可。在此执行时

安装phpunit

然互回车

安装phpunit

然后回车,注意cmd得是管理员身份,否则会显示没权限写pear.ini,执行后

安装phpunit

选择y

安装phpunit

然后出现

安装phpunit

我按提示,到目录里双击注册了。

这篇文章很好,对我帮助很大。http://wangye.org/blog/archives/266/

大致参照这个文章,只是出错时,注意命令http://blog.****.net/chinabluexfw/article/details/7355451