php “XDEBUG NOT LOADED AS ZEND EXTENSION”警告是什么意思?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10040586/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What does "XDEBUG NOT LOADED AS ZEND EXTENSION" warning means?
提问by lovespring
Xdebug is loaded, but not loaded as a zend extension. What does it mean? How to resolve this problem?
Xdebug 已加载,但未作为 zend 扩展加载。这是什么意思?如何解决这个问题?
回答by Derick
This error means that you used "extension=" to load Xdebug. That could be in your normal php.ini, or in a file called xdebug.ini that some distributions like to add. In any case, Xdebug needs to be loaded as a Zend extension for certain features such as single step debugging. As Xdebug is not meant to work as a normal extension, it might crash and burn too.
这个错误意味着你使用了“extension=”来加载 Xdebug。这可能在您的普通 php.ini 中,或者在某些发行版喜欢添加的名为 xdebug.ini 的文件中。在任何情况下,Xdebug 都需要作为 Zend 扩展来加载某些功能,例如单步调试。由于 Xdebug 不打算作为普通扩展工作,它也可能崩溃和烧毁。
The syntax for loading Xdebug as Zend extension depends on PHP version and build. I would suggest you use http://xdebug.org/wizard.phpto provide you with the correct lines.
将 Xdebug 加载为 Zend 扩展的语法取决于 PHP 版本和构建。我建议您使用http://xdebug.org/wizard.php为您提供正确的行。
回答by Starx
Make sure if it is configured to load correctly as a zend_extension. Inside php.iniadd this line
确保它配置为正确加载为zend_extension. 在里面php.ini添加这一行
zend_extension="/usr/local/php/modules/xdebug.so"
回答by Synetech
Others have already explained that the error is because Xdebug is being loaded as a regular PHP module instead of as a Zend extension. You can use the wizardthat Derick linked to or manually enter the line as Starx showed.
其他人已经解释过该错误是因为 Xdebug 被加载为常规 PHP 模块而不是 Zend 扩展。您可以使用Derick 链接的向导或手动输入 Starx 所示的行。
However, there is an issue that you may run into. The extensions_dirdirective in php.inicurrently only applies to PHP modules, not to Zend extensions. Therefore, you cannot use a common configuration like this:
但是,您可能会遇到一个问题。中的extensions_dir指令php.ini目前仅适用于 PHP 模块,不适用于 Zend 扩展。因此,您不能使用这样的通用配置:
[PHP]
extension_dir = .\ext
extension = php_memcache.dll
…
[zend]
zend_extension = php_xdebug-2.2.3-5.3-vc9-nts.dll
While PHP will correctly load php_memcache.dllfrom the extsub-directory, it will notload php_xdebug-2.2.3-5.3-vc9-nts.dlland will throw the error Failed loading php_xdebug-2.2.3-5.3-vc9-nts.dll.
虽然 PHP 会php_memcache.dll从ext子目录正确加载,但它不会加载php_xdebug-2.2.3-5.3-vc9-nts.dll并抛出错误Failed loading php_xdebug-2.2.3-5.3-vc9-nts.dll。
To fix this, you will need to either use an fully-qualified/absolute path such as:
要解决此问题,您需要使用完全限定/绝对路径,例如:
zend_extension = C:\foobar\PHP\ext\php_xdebug-2.2.3-5.3-vc9-nts.dll
or a relative path such as these:
或者像这样的相对路径:
zend_extension = ext\php_xdebug-2.2.3-5.3-vc9-nts.dll
zend_extension = ..\phpexts\php_xdebug-2.2.3-5.3-vc9-nts.dll
zend_extension = \dev\phpexts\php_xdebug-2.2.3-5.3-vc9-nts.dll
(The wizard will return zend_extension=.\ext\php_xdebug-2.2.3-5.3-vc9-nts.dllwhich includes the directory but also a superfluous .\)
(向导将返回zend_extension=.\ext\php_xdebug-2.2.3-5.3-vc9-nts.dll其中包括目录但也是多余的.\)
回答by Halayem Anis
If you want to activate zend*nts*.dllinto you php.inifile on Windows servers, you must use zend_extension_tsdirective instead of zend_extension
Example to load xdebug :
如果你想在 Windows 服务器上激活zend*nts*.dll你的php.ini文件,你必须使用zend_extension_ts指令而不是zend_extension
Example 来加载 xdebug :
[XDeug]
zend_extension_ts="DRIVE:/PATH_TO_XDEBUG/php_xdebug.dll"
xdebug.show_local_vars=1
xdebug.default_enable=On
Note : the double quotes to your dll file
注意:你的dll文件的双引号
Hope that will helps someone :)
希望这会帮助某人:)
回答by Xenos
If you end up here while trying to buildxdebug, then it means you have built it as a "static" extension (not a zend one).
如果您在尝试构建xdebug时最终出现在这里,则意味着您已将其构建为“静态”扩展(而不是 Zend 扩展)。
You can use configure --with-xdebug=sharedto build it as a shared extension (dll/so; you should see a table showing that xdebug is now configured to be built as a shared extension instead of a static one) so it can be loaded as a zend extension afterward.
您可以将configure --with-xdebug=shared其构建为共享扩展(dll/so;您应该会看到一个表格,显示 xdebug 现在被配置为构建为共享扩展而不是静态扩展),以便之后可以将其作为 zend 扩展加载。
I don't know if you can make a static zend extension.
我不知道你是否可以做一个静态的 zend 扩展。
Also, note that running the full test suite of xdebug requires to not activate opcache (configure --disable-opcache --with-xdebug=shared)
另外,请注意,运行完整的 xdebug 测试套件需要不激活 opcache ( configure --disable-opcache --with-xdebug=shared)

