Install Xdebug for PHP 7.4 on M1 Apple
P粉052686710
P粉052686710 2023-11-05 10:46:54
0
1
740

I want to install Xdebug on my Mac using M1. Due to the project I'm working on, I'm using PHP 7.4.32. I can't switch PHP versions.

When I try to install Xdebug, it says my PHP version must be updated to 8.0.0, but I still want to use 7.4.32.

$ pecl install xdebug
> pecl/xdebug requires PHP (version >= 8.0.0, version <= 8.2.99), installed version is 7.4.32
No valid packages found
install failed

The current version of PHP is installed with homewbrew.

$ brew services list
php          none  19968 user  ~/Library/LaunchAgents/homebrew.mxcl.php.plist
php@7.4      started      user  ~/Library/LaunchAgents/homebrew.mxcl.php@7.4.plist
php@8.0      none

I also run the brew update command. all is well.

How to install Xdebug for PHP 7.4.32?

P粉052686710
P粉052686710

reply all(1)
P粉155832941

According to the Compatibility page, Xdebug 3.2 is not supported on any version below PHP 8.0.

In order to install Xdebug for PHP 7.4, you need to tell PECL which version you want to install. The last Xdebug version that supports PHP 7.4 is Xdebug 3.1.6, which you can install using pecl install xdebug-3.1.6.

But you really should upgrade, as PHP 7.4 or Xdebug 3.1 are still not supported.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!