PEAR 安装后 PHPUnit CLI 不可用

发布于 2024-10-06 04:18:31 字数 311 浏览 0 评论 0原文

我已经使用以下命令在我的 OS X Snow Leopard 机器上安装了 PHPUnit:

sudo pear channel-discover pear.phpunit.de
sudo pear install phpunit/PHPUnit

我希望 phpunitCLI 命令在此之后可用,但事实并非如此。我查看了 /usr/local/bin/usr/lib/php/PHPUnit 但找不到任何看起来像 CLI 的东西。

谁能告诉我如何启动并运行 CLI?

I've installed PHPUnit on my OS X Snow Leopard box using the following command:

sudo pear channel-discover pear.phpunit.de
sudo pear install phpunit/PHPUnit

I would expect that the phpunitCLI command would be available after that, but it isn't. I've looked in /usr/local/bin and /usr/lib/php/PHPUnit but can't find anything that looks like a CLI.

Can anyone tell me how to get the CLI up and running?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

绝不放开 2024-10-13 04:18:31

我遇到了同样的问题,在 pear 安装后没有收到任何错误,但安装了一些目录和文件(在 /usr/lib/php/pear 下),而其他文件丢失了(我没有 phpunit.sh 文件等)。

我的设置:OSX Lion 10.7.2 + PHP 5.3.6 + PEAR 1.9.2。

我不能确定问题是什么,但我发现 PEAR 安装程序不是最新的,所以我将其升级(到 1.9.4):

sudo pear upgrade pear

之后,按照 phpunit 手册,我输入:

sudo pear config-set auto_discover 1

所以您不需要为每个包和依赖项添加通道。然后:

sudo pear install --alldeps pear.phpunit.de/PHPUnit

瞧,一切终于正常了!

I had the same problem, I received no errors after the pear installation, but some directories and files where installed (under /usr/lib/php/pear) and others missing (I had no phpunit.sh file among others).

My setup: OSX Lion 10.7.2 + PHP 5.3.6 + PEAR 1.9.2.

I can't really say for sure what the problem was, but I found that the PEAR installer was not up to date, so I upgraded it (to 1.9.4) with:

sudo pear upgrade pear

After that, following the phpunit manual, I typed:

sudo pear config-set auto_discover 1

So yo don't need to add the channels for every package and dependency. And then:

sudo pear install --alldeps pear.phpunit.de/PHPUnit

And voilà, everything is working finally!

鯉魚旗 2024-10-13 04:18:31

我遇到了同样的问题,在检查 安装 页面并运行以下命令后,它开始工作了。只需确保在运行它们之前将其删除即可。

sudo pear channel-discover pear.phpunit.de
sudo pear channel-discover components.ez.no
sudo pear channel-discover pear.symfony-project.com
sudo pear install phpunit/PHPUnit

I had the same problem, after checking installation page and running below commands, it started working. Just make sure to remove it before running them.

sudo pear channel-discover pear.phpunit.de
sudo pear channel-discover components.ez.no
sudo pear channel-discover pear.symfony-project.com
sudo pear install phpunit/PHPUnit
夏夜暖风 2024-10-13 04:18:31

发现频道后不要忘记清除缓存:

sudo pear clear-cache

我无法使用 PEAR 安装任何东西,清除缓存对我有用

Do not forget to clear the cache after discovering the channels:

sudo pear clear-cache

I couldn't install anything with PEAR and clearing the cache worked for me

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文