search

Home  >  Q&A  >  body text

Install Xdebug for PHP 7.4 on M1 Apple

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粉052686710P粉052686710405 days ago894

reply all(1)I'll reply

  • P粉155832941

    P粉1558329412023-11-06 09:22:54

    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.

    reply
    0
  • Cancelreply