Search code examples
phpwarningsxdebug

Xdebug: Warning: Failed loading Zend extension 'xdebug'


I'm having trouble installing xdebug on windows. I followed the instructions of xdebug wizard but it keeps giving me the warning

Warning: Failed loading Zend extension 'xdebug' (tried: C:/laragon/bin/php/php-8.2.1-nts-Win32-vs16-x64/ext\xdebug (Impossibile trovare il modulo specificato), C:/laragon/bin/php/php-8.2.1-nts-Win32-vs16-x64/ext\php_xdebug.dll (Impossibile trovare il modulo specificato)) in Unknown on line 0

I have php 8.2.1. These are the instructions:

Instructions

  1. Download php_xdebug-3.2.0-8.2-vs16-nts-x86_64.dll

  2. Move the downloaded file to C:\laragon\bin\php\php-8.2.1-nts-Win32-vs16-x64\ext, and rename it to php_xdebug.dll

  3. Update C:\laragon\bin\php\php-8.2.1-nts-Win32-vs16-x64\php.ini and add the line:
    zend_extension = xdebug

  4. Restart the Apache Webserver

I also tried changing the php version to 8.1.10 but it keeps giving me the same warning

EDIT: I used the full path

zend_extension = C:/laragon/bin/php/php-8.2.1-nts-Win32-vs16-x64/ext/php_xdebug.dll

and now give me this error

Failed loading C:/laragon/bin/php/php-8.2.1-nts-Win32-vs16-x64/ext/php_xdebug.dll


Solution

  • There is a / the wrong way around: php-8.2.1-nts-Win32-vs16-x64/ext\php_xdebug.dll — that is either because you have an extension_dir setting that is wrong, or you used zend_extension = \xdebug or something like that.

    I would recommend in this case, to use the full path in the zend_extension line:

    zend_extension = C:/laragon/bin/php/php-8.2.1-nts-Win32-vs16-x64/ext/php_xdebug.dll