Xdebug不会为我安装在我的M1 Mac上。
PHP通过Homebrew安装。
输出:
❯ file `which php`
/opt/homebrew/bin/php: Mach-O 64-bit executable arm64
❯ php --version
PHP 8.2.0 (cli) (built: Dec 9 2022 16:19:06) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.0, Copyright (c) Zend Technologies
with Zend OPcache v8.2.0, Copyright (c), by Zend Technologies
我尝试了两种方法通过PECL安装:arch -arm64 pecl install xdebug
sudo pecl install xdebug
这两种方法都会导致错误,最后4行是:
checking whether the C compiler works... no
configure: error: in `/private/tmp/pear/temp/pear-build-thatryanKQAoHZ/xdebug-3.2.1':
configure: error: C compiler cannot create executables
See `config.log' for more details
ERROR: `/private/tmp/pear/temp/xdebug/configure --with-php-config=/opt/homebrew/opt/php/bin/php-config' failed
Full Log Output Gist
我也不确定那个config.log文件在哪里…
1条答案
按热度按时间5uzkadbs1#
终于弄明白了,显然我从来没有在这台机器上安装编译器哇。所以运行
xcode-select --install
来安装gcc允许它完成。