博客 / 詳情

返回

Macbook m1 Big Sur 安裝php7.1 xdebug 折騰記

想當然的進來就是一行

$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    
user avatar dominic-giglio 頭像 mozhong_5eddab49b9d32 頭像 philip-tellis 頭像 gl115124 頭像 heyiming 頭像 liugongzi 頭像 lofanmi 頭像 mashubumaopao 頭像 lx1036 頭像 bigxia 頭像 dreamlee 頭像
11 位用戶收藏了這個故事!

發佈 評論

Some HTML is okay.