购买阿里云相关服务,这里可以领取优惠券, 有的产品5折优惠哟, 注意, 领取的优惠券30天内有效,尽快使用:
领取方式:进入链接后 页面下拉 一键领取全部 或者按需每次领取对应的优惠,领取链接:
点击此处链接领取
https://promotion.aliyun.com/ntms/act/ambassador/sharetouser.html?userCode=s306eooi&utm_source=s306eooi
如果有需要, 可以帮助部署LNMP环境, 价格80,学生可以商量
16:11 2015/11/23
5分钟windows wamp php安装phpunit 2015最新安装实践
我花了一个下午和一个上午的时间
注意:步骤中添加环境变量多的时候要保存很多步,知道窗口都自动消失完(我保存可
能点击少了一步,最后一步可能是按右上角的关闭按钮关闭的,导致一直出现phpunit
不是系统可执行命令的错误)
注意,以下网址下载的phpunit只支持php5.6以上,我的wamp2.5中php5.5支持不了,
出现提示:This version of PHPUnit requires PHP 5.6; using the latest
version of PHP is highly recommended.
最新phpunit支持php5.6以上:https://phar.phpunit.de/phpunit.phar
5.5及以下版本,选择下载相应版本:https://phpunit.de/
终于成功了,推荐参考(我的成功参考),Windows部分:
https://phpunit.de/manual/current/en/installation.html#installation.compose
r
运行:C:\bin>phpunit
结果:
PHPUnit 4.8.18 by Sebastian Bergmann and contributors.
Usage: phpunit [options] UnitTest [UnitTest.php]
phpunit [options] <directory>
Code Coverage Options:
--coverage-clover <file> Generate code coverage report in Clover XML
format.
--coverage-crap4j <file> Generate code coverage report in Crap4J XML
format.
--coverage-html <dir> Generate code coverage report in HTML format.
--coverage-php <file> Export PHP_CodeCoverage object to file.
--coverage-text=<file> Generate code coverage report in text format.
Default: Standard output.
--coverage-xml <dir> Generate code coverage report in PHPUnit XML
format.
Logging Options:
--log-junit <file> Log test execution in JUnit XML format to file.
--log-tap <file> Log test execution in TAP format to file.
--log-json <file> Log test execution in JSON format.
--testdox-html <file> Write agile documentation in HTML format to
file.
--testdox-text <file> Write agile documentation in Text format to
file.
还有很多,这里之粘贴部分..........
我通过pear方式安装失败了
中途意外发现另外的问题(与安装失败无关,是以前配置时注释符号写错了):
php.ini不能用#号做注释(有两处可能出现,1是在wamp开启后点击图标选择的
php.ini,2是在php的安装目录下的php.ini中):F:\wamp\bin\php\php5.5.12>pear
PHP Deprecated: Comments starting with '#' are deprecated in F:\wamp\bin
\php\php5.5.12\php.ini on line 128 in Unknown on line 0
PHP Deprecated: Comments starting with '#' are deprecated in F:\wamp\bin
\php\php5.5.12\php.ini on line 202 in Unknown on line 0
PHP Deprecated: Comments starting with '#' are deprecated in F:\wamp\bin
\php\php5.5.12\php.ini on line 203 in Unknown on line 0
另外显示错误:Trying to discover channel pear.phpunit.de over https://
instead
Discovery of channel "pear.phpunit.de" failed (channel-add: Cannot open
"https://pear.phpunit.de/channel.xml" (File
https://pear.phpunit.de:443/channel.xml not valid (received: HTTP/1.1 410
Gone
遇见问题,解决:https://www.baidu.com/link?url=qTkiR822UO9ucojX1-
1uCu5_1U8S284RaGoMeD8uxQNBavJorFFt0ARRiH6BNgrEXE549FeYRQTkLP-
u_OKGjAklp9JQUw7nLp3S2QmZPDq&wd=&eqid=d277cf2b0001786b000000055652ca38
无推荐博客,因为安装失败了。
执行pear config-set auto_discover 1 另有问题:PEAR_Config::writeConfigFile
fopen('C:\WINDOWS\pear.ini','w') failed (fopen(C:\WINDOWS\pear.ini): failed
to open stream: Permission denied) 说是没权限
最终发现:http://pear.phpunit.de/channel.xml无法打开,不存在了。可能pear方
法不可行了