'Xdebug 3 not showing in phpinfo on m1 Monterey

After installing xdebug with sudo pecl install xdebug it looks that is installed but only in CLI.

php -i | grep "xdebug" - this returns a lot of rows

Then when I go in my browser, in phpinfo() is nothing relate to xdebug. I've checked that I run the same php instance, both CLI and Apache are using /opt/homebrew/etc/php/7.4/php.ini ini file, I've made changes and they were visible in both CLI and Web. Also

If I try a function it returns fatal error Fatal error: Uncaught Error: Call to undefined function xdebug_info()



Solution 1:[1]

Came across this post year and a half late while trying to solve the same issue. I work on the Monterey with intel chipset.

I presume that the docs were changed from the time you posted but the command you are using is for intel chipset. You can see it here.

Current doc state.

Intel chipset:

pecl install xdebug

m1 chips(and fish :P)

arch -arm64 sudo pecl install xdebug

or

arch -x86_64 sudo pecl install xdebug

Off to solving my own old problems wish me luck and hope I helped somebody

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 milanC64