简体   繁体   English

“XDEBUG NOT LOADED AS ZEND EXTENSION”警告是什么意思?

[英]What does "XDEBUG NOT LOADED AS ZEND EXTENSION" warning means?

Xdebug is loaded, but not loaded as a zend extension. Xdebug 已加载,但未作为 zend 扩展加载。 What does it mean?这是什么意思? How to resolve this problem?如何解决这个问题?

This error means that you used "extension=" to load Xdebug.这个错误意味着你使用了“extension=”来加载 Xdebug。 That could be in your normal php.ini, or in a file called xdebug.ini that some distributions like to add.这可能在您的正常 php.ini 中,或者在某些发行版喜欢添加的名为 xdebug.ini 的文件中。 In any case, Xdebug needs to be loaded as a Zend extension for certain features such as single step debugging.在任何情况下,Xdebug 都需要作为 Zend 扩展加载,以实现某些功能,例如单步调试。 As Xdebug is not meant to work as a normal extension, it might crash and burn too.由于 Xdebug 并不意味着作为一个普通的扩展工作,它也可能会崩溃和烧毁。

The syntax for loading Xdebug as Zend extension depends on PHP version and build.加载 Xdebug 作为 Zend 扩展的语法取决于 PHP 版本和构建。 I would suggest you use http://xdebug.org/wizard.php to provide you with the correct lines.我建议您使用http://xdebug.org/wizard.php为您提供正确的线路。

Make sure if it is configured to load correctly as a zend_extension .确保它是否配置为作为zend_extension正确加载。 Inside php.ini add this linephp.ini里面添加这一行

zend_extension="/usr/local/php/modules/xdebug.so"

Others have already explained that the error is because Xdebug is being loaded as a regular PHP module instead of as a Zend extension.其他人已经解释说错误是因为 Xdebug 被加载为常规 PHP 模块而不是 Zend 扩展。 You can use the wizard that Derick linked to or manually enter the line as Starx showed.您可以使用 Derick 链接到的向导或手动输入 Starx 显示的行。

However, there is an issue that you may run into.但是,您可能会遇到一个问题。 The extensions_dir directive in php.ini currently only applies to PHP modules, not to Zend extensions . php.ini中的extensions_dir指令目前仅适用于 PHP 模块,不适用于 Zend 扩展 Therefore, you cannot use a common configuration like this:因此,您不能使用这样的通用配置:

[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.dll from the ext sub-directory, it will not load php_xdebug-2.2.3-5.3-vc9-nts.dll and will throw the error Failed loading php_xdebug-2.2.3-5.3-vc9-nts.dll .虽然 PHP 将从ext子目录正确加载php_memcache.dll ,但它不会加载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.dll which includes the directory but also a superfluous .\ ) (该向导将返回zend_extension=.\ext\php_xdebug-2.2.3-5.3-vc9-nts.dll ,其中包括目录,但也有多余的.\

If you want to activate zend*nts*.dll into you php.ini file on Windows servers, you must use zend_extension_ts directive instead of zend_extension如果你想激活zend*nts*.dll到你php.ini文件,你必须使用zend_extension_ts指令而不是zend_extension

Example to load xdebug:加载 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:)希望这会帮助某人:)

If you end up here while trying to build xdebug, then it means you have built it as a "static" extension (not a zend one).如果您在尝试构建xdebug 时停在此处,则意味着您已将其构建为“静态”扩展(而非 zend 扩展)。

You can use configure --with-xdebug=shared to 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 现在已配置为构建为共享扩展而不是 static ),因此它可以之后作为 zend 扩展加载。

I don't know if you can make a static zend extension.我不知道你是否可以做一个 static 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

Worked for me: in php.ini为我工作:在 php.ini

zend_extension = php_xdebug-3.0.4-8.0-vs16-x86_64.dll

First of all In PHP 5.3 and later, you need to use only zend_extension , not zend_extension_ts , zend_extension_debug , or extension .首先,在PHP 5.3及更高版本中,您只需要使用zend_extension而不是zend_extension_tszend_extension_debugextension

The php.ini file should look like this php.ini 文件应如下所示

[xdebug]
zend_extension="C:\xampp\php\ext\php_xdebug-3.2.0RC2-8.1-vs16-x86_64.dll"
xdebug.mode=debug
xdebug.client_host=127.0.0.1

Attention!!注意力!! to avoid errors you need to install the correct xdebug library file.为避免错误,您需要安装正确的 xdebug 库文件。

For example, assuming you using windows and install this xamp version xampp-windows-x64-8.1.10-0-VS16-installer .例如,假设您使用 windows 并安装此xamp版本xampp-windows-x64-8.1.10-0-VS16-installer The valid .dll xdebug file would be PHP 8.1 VS16 TS (64 bit) to download.要下载的有效.dll xdebug 文件为PHP 8.1 VS16 TS (64 bit)

Do all the above and i guarantee no loading errors or problems执行以上所有操作,我保证没有加载错误或问题

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

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