I want to instal mulible versions of xdebug based in each php version in brew
I have multiple versions of PHP using brew. when I want to switch between for example from PHP 7.4 to PHP 8.1 I use this command
brew unlink [email protected] && brew link [email protected]
When I download xdebug for PHP 8.1 I use
pecl install xdebug
It would install xdebug's latest version until now. So if I write
pecl list
I get
Package Version State
imagick 3.7.0 stable
xdebug 3.2.2 stable
when I open /usr/local/etc/php/8.1/php.ini I get
zend_extension="xdebug.so"
That's fine until now.
now the problem is when I want to install a lower version for my PHP 7.4 (because the newer version of xdebug is not compatible with PHP 7.4). so accoarding to this page I should download at most xdebug-3.1 for php 7.
so I will switch to PHP 7 using
brew unlink [email protected] && brew link [email protected]
then I download a compatible xdebug version with PHP 7.4 using this command
pecl install xdebug-3.1.6
it will be downloaded fine, but I get this issue whenever I use PHP, e.g php -v
Failed loading /usr/local/opt/[email protected]/pecl/20210902/xdebug.so: dlopen(/usr/local/opt/[email protected]/pecl/20210902/xdebug.so, 0x0009): symbol not found in flat namespace (_instanceof_function_slow)
I guess because it didn't know the path for xdebug.
if I open /usr/local/etc/php/7.4/php.ini I get
zend_extension="xdebug.so"
I tried to change the path in php.ini in php.7 to /usr/local/opt/[email protected]/pecl/20210902/xdebug.so because there is an xdebug file in this path, but the problem remains.
how can I fix this problem?
Please or to participate in this conversation.