Macbook m1 Big Sur 安装php7.1 xdebug 折腾记

buildyuan

想当然的进来就是一行

$sudo pecl install xdebug
pecl/xdebug requires PHP (version >= 7.2.0, version <= 8.0.99), installed version is 7.1.33
No valid packages found
install failed

查阅了一下xdebug的下载页,默认安装的xdebug3已经不支持php7.1了。
php7.1只配安装xdebug2,根据在下载页查到的最后一个支持php7.1的版本是2.9.8

$sudo pecl install xdebug-2.9.8                                               
downloading xdebug-2.9.8.tgz ...
Starting to download xdebug-2.9.8.tgz (245,293 bytes)
...................................................done: 245,293 bytes
Build process completed successfully
Installing '/opt/homebrew/Cellar/php@7.1/7.1.33/pecl/20160303/xdebug.so'
install ok: channel://pecl.php.net/xdebug-2.9.8
Extension xdebug enabled in php.ini

检查一下是否安装成功

$php -v
PHP 7.1.33 (cli) (built: Dec 25 2020 07:27:59) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
    with Xdebug v2.9.8, Copyright (c) 2002-2020, by Derick Rethans
    with Zend OPcache v7.1.33, Copyright (c) 1999-2018, by Zend Technologies
    
$php -m | grep debug
xdebug
Xdebug    
阅读 1.7k

老猿搜题
老猿写代码中的各种问题

talk is cheap,show me the code

74 声望
5 粉丝
0 条评论
你知道吗?

talk is cheap,show me the code

74 声望
5 粉丝
文章目录
宣传栏