Skip to content

Instantly share code, notes, and snippets.

@yexingzhe
Last active December 14, 2015 20:09
Show Gist options
  • Save yexingzhe/5141733 to your computer and use it in GitHub Desktop.
Save yexingzhe/5141733 to your computer and use it in GitHub Desktop.
windows下安装phpUnit

netbeans支持phpUnit调试,于是我打算试试 http://netbeans.org/kb/docs/php/phpunit_zh_CN.html

1:到php目录下找到go-pear.bat并运行,实际是执行php.exe PEAR/go-pear.phar,按照提示一路安装pear 2: pear install phpunit/PHPUnit 注意大小写 3:pear install 其他组件 http://www.phpunit.de/manual/current/en/installation.html#installation.pear

注意事项:PHP5.2.6这个版本太老,装不了太新的组件,为了这事我升级到php5.2.17 于是引发了: PHP需要下载线程安全版本也就是ts版的 PHP5.2版的在windows.php.net下可以下载到,到PHP官方主站找不到 然后停apache,拷贝覆盖,保留php.ini等,再来一遍

netbeans上设置phpunit路径的地方写了使用版本3.7以上才能使用构建器 经过一下午的实验phpUnit仍未装上,再次仔细阅读官方说明: http://www.phpunit.de/manual/3.7/en/installation.html

PHPUnit 3.7 requires PHP 5.3.3 (or later) but PHP 5.4.7 (or later) is highly recommended.

好吧,我干脆一路升到5.4算了。 PHPUnit 3.8 requires PHP 5.4.7 (or later) but PHP 5.5.0 (or later) is highly recommended.

pear config-set auto_discover 1 pear install pear.phpunit.de/PHPUnit pear install phpunit/PHPUnit_Selenium pear install phpunit/PHPUnit_SkeletonGenerator

有的时候会需要用 pear clear-cache

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment