• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

window顶用pear安装phpunit

php 搞代码 3年前 (2022-01-24) 13次浏览 已收录 0个评论

window中用pear安装phpunit
1.安装pear
1)在命令行中,进入php安装目录,如我的目录D:\php\Zend\ZendServer\bin,运行:

go-pear
若出现以下错误:
phar “D:\php\Zend\ZendServer\bin\PEAR\go-pear.phar” does not have a signature
Warning: require_once(phar://go-pear.phar/index.php): failed to open stream: pha
r error: invalid url or non-existent phar “phar://go-pear.phar/index.php” in D:\
php\Zend\ZendServer\bin\PEAR\go-pear.phar on line 1236

解决方法:打开php.ini文件,在最后一行加上:phar.require_hash = Off

4)此时pear应该安装成功了,更新至最新版本:

pear upgrade-all
(这一步挺重要的,phpunit貌似是使用pear的1.9.x才能安装)
2.安装phpunit:
1)添加phpunit的频道

pear channel-discover pear.phpunit.de
pear channel-discover components.ez.no
pear channel-discover pear.symfony-project.com
2)安装:

pear install phpunit/PHPUnit
若出现此错误:
Fatal error:require_once():Failed opening required ‘Structures/Graph.php’
解决方法如下,下载此压缩包:

http://download.pear.php.net/package/Structures_Graph-1.0.3.tgz

解压并把Structures目录复制到D:\php\Zend\ZendServer\bin\PEAR下

若出现:
could not extract the package.xml file
Error:cannot download “phpunit/XXXX”

!本文来源gaodai.ma#com搞##代!^码网(

搞gaodaima代码
可能是pear下载目录的路径有空格如:D:/program files/
解决方法如下:

pear config-set temp_dir “C:\tmp”
pear config-set download_dir “C:\tmp”
这里设置目录的路径无空格就行了,想设哪里到是无所谓。

最后测试下是否安装成功,cmd中运行:

phpunit

3、zendStudio8 整合phpunit

1)、首先在zend studio 中新建一个项目。
2)、在项目项目上右键 出现 Properties ,点击 Properties 在出现的框中选择 PHP Include Path -> Libraries -> Add Library ,选择PHPUnit 3.x 即可。


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:window顶用pear安装phpunit

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址