zf工具& PHPunit 在 include_path 中无法识别

发布于 2024-12-28 13:23:00 字数 512 浏览 3 评论 0原文

我已经为此苦苦挣扎了一段时间。

当使用 Zend Framework 1.11 中包含的 zf 工具创建项目和操作等时,我总是收到通知,在包含路径中找不到 PHPUnit,因此测试尚未自动创建。我知道这只是一个通知,而不是一个错误,但我希望它能够工作。

我正在使用 OS X 10.7 和 MAMP,我在 MAMP 中的包含路径如下:

include_path = ".:/Applications/MAMP/bin/php/php5.3.6/lib/php:/Applications/MAMP/bin/php/php5.3.6/lib/php/PHPUnit"

到目前为止我在互联网上发现的问题的唯一提示是 zf 工具正在使用本机安装的 php 和包含路径,因此没有注意到PHPUnit。

我想我可以找到 php.ini 文件并将 PHPUnit 添加到它的包含路径中,但感觉有点像黑客。

有没有办法“优先”安装 php?

谢谢你的帮助。

I've be struggling with this for a while.

When using the zf tool included in the Zend Framework 1.11 to both create projects and actions and so on, I always get the notice that PHPUnit was not found in the include path and hence the test have not automatically been created. I know that this is only a notice and not an error however I would like it to work.

I am using OS X 10.7 and MAMP, my include path in MAMP is as follows:

include_path = ".:/Applications/MAMP/bin/php/php5.3.6/lib/php:/Applications/MAMP/bin/php/php5.3.6/lib/php/PHPUnit"

The only hint of the problem I have found so far on the internet is that the zf tool is using the natively installed php and include path and hence not noticing the PHPUnit.

I suppose that I could find the php.ini file and add the PHPUnit to it's include path but it feels a little bit of a hack.

Is there away to "prioritise" php installs?

Thank you for you help.

Al

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

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

发布评论

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

评论(1

扎心 2025-01-04 13:23:00

我终于在 http://wiki.dreamhost.com/Zend_framework 找到了答案

基本上遵循步骤 5。

无论如何,请替换

# find php: pear first, command -v second, straight up php lastly
if test "@php_bin@" != '@'php_bin'@'; then
    PHP_BIN="@php_bin@"
elif command -v php 1>/dev/null 2>/dev/null; then
    PHP_BIN=`command -v php`
else
    PHP_BIN=php
fi

PHP_BIN=/Applications/MAMP/bin/php/php5.3.6/bin/php

感谢您的帮助。

I have finally found the answer at http://wiki.dreamhost.com/Zend_framework

Basically follow Step 5.

Replace

# find php: pear first, command -v second, straight up php lastly
if test "@php_bin@" != '@'php_bin'@'; then
    PHP_BIN="@php_bin@"
elif command -v php 1>/dev/null 2>/dev/null; then
    PHP_BIN=`command -v php`
else
    PHP_BIN=php
fi

with

PHP_BIN=/Applications/MAMP/bin/php/php5.3.6/bin/php

Thank for your help anyway.

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