我在 OS X (10.7.5) 上安装了 Zend Server CE,我通过 PEAR 安装了 PHPUnit
$ which pear
/usr/local/zend/bin/pear
$which php
/usr/local/zend/bin/php
$php -v
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans
with Zend Extension Manager v6.0.0, Copyright (c) 2003-2013, by Zend Technologies
- with Zend Data Cache v6.0.0, Copyright (c) 2004-2013, by Zend Technologies [loaded] [licensed] [disabled]
- with Zend Job Queue v6.0.0, Copyright (c) 2004-2013, by Zend Technologies [loaded] [licensed] [enabled]
- with Zend Utils v6.0.0, Copyright (c) 2004-2013, by Zend Technologies [loaded] [licensed] [enabled]
- with Zend Optimizer+ v6.0.0, Copyright (c) 1999-2013, by Zend Technologies [loaded] [licensed] [disabled]
- with Zend Code Tracing v6.0.0, Copyright (c) 2009-2013, by Zend Technologies [loaded] [licensed] [enabled]
- with Zend Monitor v6.0.0, Copyright (c) 1999-2013, by Zend Technologies [loaded] [licensed] [disabled]
- with Zend Page Cache v6.0.0, Copyright (c) 2004-2013, by Zend Technologies [loaded] [licensed] [disabled]
$ which phpunit
/usr/local/zend/bin/phpunit
但是当我执行时:
$ phpunit
在测试目录中(具有正确的配置和引导),我收到以下错误:
/usr/local/zend/bin/phpunit: line 2: ?php: No such file or directory
/usr/local/zend/bin/phpunit: line 3: /Applications: is a directory
/usr/local/zend/bin/phpunit: line 4: Bootstrap.php: command not found
/usr/local/zend/bin/phpunit: line 5: syntax error near unexpected token `('
/usr/local/zend/bin/phpunit: line 5: ` * Copyright (c) 2001-2013, Sebastian Bergmann <sebastian@phpunit.de>.'
但是如果我运行:
$ php /usr/local/zend/bin/phpunit
一切正常。
让我扩展一下:
which phpdoc
返回/usr/local/zend/bin/phpdoc
但从phpdoc
测试文件夹内部运行返回
/usr/local/zend/bin/phpdoc: line 2: ?php: No such file or directory
/usr/local/zend/bin/phpdoc: line 3: /Applications: is a directory
/usr/local/zend/bin/phpdoc: line 4: LICENSE.txt: command not found
/usr/local/zend/bin/phpdoc: line 5: LICENSE.txt: command not found
/usr/local/zend/bin/phpdoc: line 6: LICENSE.txt: command not found
/usr/local/zend/bin/phpdoc: line 7: LICENSE.txt: command not found
/usr/local/zend/bin/phpdoc: line 8: syntax error near unexpected token `('
/usr/local/zend/bin/phpdoc: line 8: ` * @copyright 2010-2013 Mike van Riel / Naenius (http://www.naenius.com)'
知道为什么会这样吗?