PHPUnit 在哪里?
已解决!
我从 pear 中卸载了 phpunit,然后再次重新安装。我相信在安装之前我使用了错误/旧/不足的源。效果就像一个魅力!
所以我正在尝试设置 PEAR & PHPUnit。我正在关注 http://www.newmediacampaigns。 com/page/install-pear-phpunit-xdebug-on-macosx-snow-leopard 但在我安装了 pear 之后,我在 /usr/local 中有一个不同的目录结构。无论如何,我能够运行 phpunit 安装。但现在我迷路了,在弄出更大的混乱之前寻求帮助:)
pear config-show 说:
PEAR directory php_dir /usr/local/share/pear
而我的 php.ini 文件(并在 phpinfo() 中确认)说:
include_path=".:/usr/local/share/pear"
所以这很好,对吧?但现在怎么办?我得到
无法打开所需的“PHPUnit/Framework.php”(include_path='.:/usr/local/share/pear')
如果我尝试将其包含在 php.ini 文件中, 我不知道二进制文件可能在哪里从命令行运行它。
在 /usr/local/share/pear/PHPUnit
内部有两个目录 "Extensions"
和 "Framework"
Resolved!
I uninstalled phpunit from pear and then reinstalled it again. I believe I was using the wrong/old/not enough sources before installing. Works like a charm!
So I'm trying to set up PEAR & PHPUnit. I was following http://www.newmediacampaigns.com/page/install-pear-phpunit-xdebug-on-macosx-snow-leopard but after I installed pear I had a different directory structure in /usr/local. Regardless, I was able run the phpunit install. But now I'm lost and asking for help before I make a bigger mess :)
pear config-show says:
PEAR directory php_dir /usr/local/share/pear
And my php.ini file (and confirmed in phpinfo() says:
include_path=".:/usr/local/share/pear"
So that's good, right? But now what? I get
Failed opening required 'PHPUnit/Framework.php' (include_path='.:/usr/local/share/pear')
If I try to include it in the php. And I have no idea where the binary might be to run it from the command line.
Inside /usr/local/share/pear/PHPUnit
there are two directories "Extensions"
and "Framework"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有时会发生安装在 PHPUnit 上失败的情况,但在依赖项上安装成功,因此它只是看起来安装成功。
安装时尝试此
--force
选项将强制安装 PHPUnit,即使无法满足所有依赖项。就我而言,尽管可以使用 PHP_Invoker 包,但 dom PHP 扩展缺少依赖项,这会阻止安装。--alldeps
选项可确保安装所有依赖项。It sometimes happen that the install fails on PHPUnit specifically, but succeeds on the dependencies, so it only looks like the install was succesfull.
Try this when installing
The
--force
option will force the install of PHPUnit, even if all the dependencies can't be met. In my case there was a missing dependency for the dom PHP extension which blocked the installation even though thePHP_Invoker
package could be used instead.The
--alldeps
option makes sure that all of the dependencies got installed.检查 pear 安装中的 bin 目录,类似于
/usr/local/share/pear/bin/
- 您的安装与我的不同。您也可以尝试搜索二进制文件-
Check for a bin directory in the pear install, something along the lines of
/usr/local/share/pear/bin/
- your install is different than mine..You could also try searching for the binary -