Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xdebug error on local environment [Failed loading /usr/local/lib/php/pecl/20190902/xdebug.so:]

I want to use Xdebug on the vscode.

I tried it while reading the official documentation, but I couldn’t get it to work and got the following error.

Failed loading /usr/local/lib/php/pecl/20190902/xdebug.so:  dlopen(/usr/local/lib/php/pecl/20190902/xdebug.so, 9): no suitable image found.  Did find:
        /usr/local/lib/php/pecl/20190902/xdebug.so: stat() failed with errno=20

php --ini

Failed loading /usr/local/lib/php/pecl/20190902/xdebug.so:  dlopen(/usr/local/lib/php/pecl/20190902/xdebug.so, 9): no suitable image found.  Did find:
    /usr/local/lib/php/pecl/20190902/xdebug.so: stat() failed with errno=20
Configuration File (php.ini) Path: /usr/local/etc/php/7.4
Loaded Configuration File:         /usr/local/etc/php/7.4/php.ini
Scan for additional .ini files in: /usr/local/etc/php/7.4/conf.d
Additional .ini files parsed:      /usr/local/etc/php/7.4/conf.d/ext-opcache.ini

Has anyone else encountered the same problem? Thank you.

like image 236
fedorovaru Avatar asked Oct 15 '25 05:10

fedorovaru


1 Answers

I got this working by doing something similar to this: https://stackoverflow.com/a/48054252

I added

export PATH="$(brew --prefix php)/bin:$PATH"

to ~/.bash_profile.

You can run source ~/.bash_profile after editing the file to get the changes to take effect.

like image 157
afifer Avatar answered Oct 17 '25 20:10

afifer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!