Reputation: 19569
Xdebug is loaded, but not loaded as a zend extension. What does it mean? How to resolve this problem?
Upvotes: 19
Views: 44141
Reputation: 3214
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
.
The php.ini file should look like this
[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.
For example, assuming you using windows and install this xamp
version 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.
Do all the above and i guarantee no loading errors or problems
Upvotes: 2
Reputation: 111
Worked for me: in php.ini
zend_extension = php_xdebug-3.0.4-8.0-vs16-x86_64.dll
Upvotes: 1
Reputation: 3507
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).
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.
I don't know if you can make a static zend extension.
Also, note that running the full test suite of xdebug requires to not activate opcache (configure --disable-opcache --with-xdebug=shared
)
Upvotes: 0
Reputation: 7785
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
Example to load 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
Hope that will helps someone :)
Upvotes: 3
Reputation: 9925
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 wizard that Derick linked to or manually enter the line as Starx showed.
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. 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
.
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 .\
)
Upvotes: 5
Reputation: 36784
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.
The syntax for loading Xdebug as Zend extension depends on PHP version and build. I would suggest you use http://xdebug.org/wizard.php to provide you with the correct lines.
Upvotes: 27
Reputation: 78991
Make sure if it is configured to load correctly as a zend_extension
. Inside php.ini
add this line
zend_extension="/usr/local/php/modules/xdebug.so"
Upvotes: 4