Zend Server CE 上的 PHPUnit 出现问题 - MacOSX
我已经在 MacOS Lion 上安装了 Zend Server CE,除了 PHPUnit 之外,一切都运行顺利。
我的 PHPUnit 安装是通过 Zend Server CE 附带的 PERL 进行的。
这是我通过控制台运行 phpunit 时的输出:
Failed loading ”/usr/local/zend/lib/php_extensions/xdebug.so”: dlopen(”/usr/local/zend/lib/php_extensions/xdebug.so”, 9): image not found
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/zend/lib/php_extensions/mcrypt.so' - dlopen(/usr/local/zend/lib/php_extensions/mcrypt.so, 9): Library not loaded: /usr/lib/libltdl.3.dylib
Referenced from: /usr/local/zend/lib/php_extensions/mcrypt.so
Reason: image not found in Unknown on line 0
PHP Warning: Xdebug MUST be loaded as a Zend extension in Unknown on line 0
PHP Fatal error: Call to undefined method PHP_CodeCoverage_Filter::getInstance() in /usr/local/bin/phpunit on line 39
PHP Stack trace:
PHP 1. {main}() /usr/local/bin/phpunit:0
有人知道问题可能是什么吗?
谢谢和问候!
I've installed Zend Server CE on my MacOS Lion, and everything is running smooth except from PHPUnit.
My installation of PHPUnit was made from the PERL that comes with Zend Server CE.
Here is the output from when I run phpunit through the console:
Failed loading ”/usr/local/zend/lib/php_extensions/xdebug.so”: dlopen(”/usr/local/zend/lib/php_extensions/xdebug.so”, 9): image not found
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/zend/lib/php_extensions/mcrypt.so' - dlopen(/usr/local/zend/lib/php_extensions/mcrypt.so, 9): Library not loaded: /usr/lib/libltdl.3.dylib
Referenced from: /usr/local/zend/lib/php_extensions/mcrypt.so
Reason: image not found in Unknown on line 0
PHP Warning: Xdebug MUST be loaded as a Zend extension in Unknown on line 0
PHP Fatal error: Call to undefined method PHP_CodeCoverage_Filter::getInstance() in /usr/local/bin/phpunit on line 39
PHP Stack trace:
PHP 1. {main}() /usr/local/bin/phpunit:0
Does anybody know what the problem or problems could be?
Thanks and regards!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好的,这是我的第一个答案。所以对我宽容点吧。
今晚我在 OSX Lion 上使用 Zend Server CE 时遇到了同样的问题。为了解决这些问题,您必须安装 xcode,因为需要 unix 开发工具。
让我们开始吧,您有两个问题:xdebug.so 和 libltdl.3.dylib
First xdebug.so未找到,要安装它,您应该从命令行运行以下命令:
它将询问您密码(如果您没有密码,只需按 Enter 键)。然后:
前四行强制编译器生成 32 位二进制文件,因为 Zend Server 是 32 位二进制文件,而 OSX Lion 是 64 位操作系统。
好吧,现在您应该已经在 */usr/local/zend/lib/php_extensions* 上安装了 xdebug.so,只需确保您的 /usr/local/zend/etc/php.ini 已安装。 ini 文件在所有其他扩展之后和 [zend] 部分之前使用以下行加载 xdebug:
这是我的 php.ini 中的片段:
如果没有不,请添加它手动,然后检查您的 php.ini 文件是否包含以下行并将其删除,因为 xdebug 必须作为 Zend 扩展加载。
第二,一旦你安装了 xcode,libltdl.dylib 将在 /usr/lib 中可用,因此你可以创建一个符号链接使用以下命令:
下次运行 phpunit 时,一切都会顺利进行(尽管尚未测试任何 mcrypt 函数)。
Ok, this is my first answer. So go easy on me.
Tonight I had the very same issues with Zend Server CE on OSX Lion. In order to solve them, you'll have to install xcode as the unix development tools are required.
Let's get started, you have two issues: xdebug.so and libltdl.3.dylib
First xdebug.so is not found, to install it you should run the following from the command line:
It will ask you for you password (if you don't have one just press the enter key). Then:
The first four lines, force the compiler to generate a 32 bit binary, as Zend Server is a 32 bit binary and OSX Lion is a 64 bit operating system.
Alright, now you should have xdebug.so installed on */usr/local/zend/lib/php_extensions*, just make sure that your /usr/local/zend/etc/php.ini file loads xdebug with the following line after all other extensions and before the [zend] section:
Here's the fragment from my php.ini:
If it doesn't please add it manually, then check if your php.ini file contains the following line and delete it as xdebug must me loaded as a Zend extension.
Second, as soon as you install xcode, libltdl.dylib will be available in /usr/lib, so you can create a symbolic link to it with the following command:
Next time you run phpunit everything should go smoothly (haven't tested any mcrypt functions though).
当我尝试启动 phpunit 时,我刚刚遇到了 mcrypt 的问题。
如果您使用 sudo 运行 phpunit,则不会出现警告:)
I just ran into the problem with the mcrypt, when I tried to start the phpunit.
The warning does not appear, if you run phpunit with sudo :)