简体   繁体   English

PHPUnit在终端上运行,但不在NetBeans中运行

[英]PHPUnit runs on Terminal but not in NetBeans

I'm running Mac OS X 10.6 w/ bitnami mampstack 5.4.11 (PHP 5.4.11) and NetBeans 7.2.1. 我正在运行带bitnami mampstack 5.4.11(PHP 5.4.11)和NetBeans 7.2.1的Mac OS X 10.6。 Since I've switched from XAMPP (for Mac) w/ PHP 5.3.x to 5.4+ NB can't use PHPUnit or any other bash script. 由于我已经从使用PHP 5.3.x的XAMPP(适用于Mac)切换到5.4+,因此NB无法使用PHPUnit或任何其他bash脚本。 PHPUnit is up and running and works like a charm via Terminal. PHPUnit已启动并运行,并且可以通过Terminal像超级按钮一样工作。 But in NB I get this: 但是在NB我得到这个:

/Applications/mampstack-5.4.11/php/bin/phpunit: line 2: ?php: No such file or directory

Looks like php didn't interprete the actual php code ... I've no idea why this happens and how to fix this. 看起来php并没有解释实际的php代码...我不知道为什么会发生这种情况以及如何解决此问题。

Some setup details: 一些设置细节:

  • My mampstack is located at /Applications/mampstack-5.4.11/ 我的Mampstack位于/Applications/mampstack-5.4.11/
  • php interpreter is set to /Applications/mampstack-5.4.11/php/bin/php within NB config php解释器在NB配置中设置为/Applications/mampstack-5.4.11/php/bin/php
  • include paths are set and working in php as well as in NB 包含路径已设置并在php和NB中工作
  • path to php binary within PHPUnit bash script is correct (/Applications/mampstack-5.4.11/php/bin/php) PHPUnit bash脚本中php二进制文件的路径正确(/Applications/mampstack-5.4.11/php/bin/php)
  • none of the scripts that go like #!/path/to/php/executable \\n work within NB anymore 像#!/ path / to / php / executable \\ n这样的脚本都无法在NB中运行

Any ideas on how to fix this? 有想法该怎么解决这个吗?

Also postet this question on the NetBeans Forums . 也可以在NetBeans论坛上发布此问题。

Fixed it by creating a phpunit.sh and phpunit-skelgen.sh within [...]/php/bin with 通过在[...] / php / bin中创建一个phpunit.sh和phpunit-skelgen.sh来解决此问题

#!/bin/sh
/Applications/mampstack-5.4.11/php/bin/php /Applications/mampstack-5.4.11/php/bin/phpunit "$@"

and

#!/bin/sh
/Applications/mampstack-5.4.11/php/bin/php /Applications/mampstack-5.4.11/php/bin/phpunit-skelgen "$@"

and ponting to it within NetBeans config. 并在NetBeans配置中对此进行响应。

Thanks to victor ♦♦ from bitnami answers. 多亏了Bitnami答案的胜利者♦♦。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM