在 Windows 中使用 PEAR 和不使用 PEAR 安装 PHPUnit 时都会出现问题
我尝试使用 PEAR 连接到 pear.phpunit.de 和其他三个类似的连接,但由于连接超时而无法连接,在更新 PEAR 中的连接后,没有任何进展。
另外,我尝试通过更改 phpunit.php 文件中的 @PHPBIN@ 并重命名它来安装没有 PEAR 的 PHPunit,然后无法在 DOS 中将其作为可执行文件运行(chmod 在 DOS 中不起作用,是按步骤编写的,我遵循了)
是否有任何其他简单的方法可以让 PHPUnit 在 Wamp 服务器下的 Windows 中工作。请回复,目前所有事情都悬而未决。
I have tried connecting to pear.phpunit.de and three other similar connections using PEAR, but could not due to connection timeout, after updating connection also in PEAR, no progress.
Also, I have tried installing PHPunit without PEAR by changing @PHPBIN@ in phpunit.php file and renaming it, then cannot run it as an executable file in DOS (chmod does'nt work in DOS, was written in steps, which i followed)
Is there any other simple way to get PHPUnit working in Windows under Wamp server. Please respond, all things hanging on it presently.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
尝试:
如果 PHPUnit 安装了,但您仍然无法运行单元测试,您可能必须将 phpunit 文件移到一个目录下。因此,如果您的 php.exe 文件位于 C:\wamp\bin\php\php5.2.11\ 中,您应该有如下内容:
Try:
If PHPUnit installs, but you still can't run a unit test, you might have to move the phpunit file down one directory. So if your php.exe file is in C:\wamp\bin\php\php5.2.11\ you should have something like this:
问题是临时目录路径中的空格阻止 pear 安装软件包。
还尝试清空 pear 缓存目录(%appdata% 本地临时目录中的某个位置)。
the problem is that whitespaces in the path of the temp dir prevents pear from installing the package.
Also try to empty the pear cache directory (somewhere in %appdata% local temp).
自 2014 年 12 月 31 日起,pear.phpunit.de 将被关闭,因此这是在您的计算机上配置 PHPUnit 的另一种方法:
右键单击并打开“phpunit.cmd”在编辑模式下,复制并粘贴以下行并保存文件:
<块引用>
@php"%~dp0\phpunit.phar"%*
此时你应该在 "C:\phpunit" 下有 "phpunit.cmd" 和 "phpunit.phar"
将此行添加到 PATH 变量的开头,不要忘记分号:
<块引用>
C:\phpunit;
单击“确定”保存编辑,打开命令提示符并输入“phpunit --version”
As of December 31 2014 pear.phpunit.de will be shut down, so here is another way of configuring PHPUnit on your machine:
Right-click and open "phpunit.cmd" in edit mode, copy>paste the following line and save the file:
At this point you should have "phpunit.cmd" and "phpunit.phar" under "C:\phpunit"
Add this line to the very beginning of your PATH variable and don't forget the semicolon:
Click OK to save the edit, Open Command Prompt and type "phpunit --version"