Skip to content
Advertisement

Error to Install xdebug on Mac OS with php 8

I just want to do phpunit --coveragefor my project first I got this error:

JavaScript

I just check my php to make sure I have xdebug via php -v

JavaScript

seems I do not have it then I just install it via pecl install xdebug Homebrew I got this error at the end of installation:

JavaScript

Advertisement

Answer

You can step by step debug this problem with starting to check what it is inside the /usr/local/Cellar/php/8.0.0_1 folder running

JavaScript

I tend to say that there is a pecl symlink already existing which is why pecl cannot create a folder there.

Then you should check where pecl is installed by running which pecl which ideally gives you /usr/local/bin/pecl which should point to somewhere /usr/local/Cellar/php/8.0.0_1/bin/pecl.

If that is the case you can remove the /usr/local/Cellar/php/8.0.0_1/pecl symlink with

JavaScript

and try to reinstall xdebug.

Now fixing the image not found issue

This comes from an incorrect configuration during the xdebug installation.

First, check what the path to your php.ini file is by running ˋphp —-iniˋ. Then open the file and check the First line if there is your xdebug Extension loaded. If yes, remove it there. Then add a file xdebug.conf in the conf.d folder and add the following:

JavaScript

Please check that you have the correct path to your xdebug.so file and that the output dir exists.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement