【问题标题】:Install xdebug failing on Mac在 Mac 上安装 xdebug 失败
【发布时间】:2025-11-24 11:50:02
【问题描述】:

我正在运行带有 PHP 7.4.19 的 MacOS Big Sur(版本 11.4)。我正在尝试使用 homebrew 安装 xdebug:

pecl install xdebug

但它失败了:

5 warnings and 4 errors generated.
make: *** [xdebug.lo] Error 1
ERROR: `make' failed

我尝试下载源代码并运行 make 但我得到了同样的错误:

In file included from /usr/local/Cellar/php@7.4/7.4.19_1/include/php/Zend/zend.h:356:
/usr/local/Cellar/php@7.4/7.4.19_1/include/php/Zend/zend_operators.h:523:10: error: 
      'asm goto' constructs are not supported yet
        __asm__ goto(

我用谷歌搜索无济于事。有没有其他人遇到过这种情况?

【问题讨论】:

    标签: macos xdebug php-7.4


    【解决方案1】:

    这是因为编译器之间的不匹配。您没有足够包含有关哪个部分由哪个编译器编译的信息,但其中一个是由 LLVM 编译的,另一个是由 GCC 编译的。这会导致mismatch

    您需要确保为两者使用相同的编译器。

    【讨论】:

    • 您可能使用错误的 PHP 版本运行它?哪一个? pecl -V 会将它们全部列出。
    • 添加 FWIW,当你运行 pecl install xdebug 时,输出会告诉你正在使用哪个编译器。将整个输出放在某个地方供我们查看。
    • AIP-DWINTERFELD-MAC:~ dorianwinterfeld$ pecl -V PEAR 版本:1.10.12 PHP 版本:7.4.19 Zend 引擎版本:3.4.0 运行于:Darwin AIP-DWINTERFELD-MAC.fios -router.home
    • 呃,AIP-DWINTERFELD-MAC:~ dorianwinterfeld$ pecl install xdebug 没有可用于包“pecl.php.net/xdebug”的版本安装失败
    • 我也尝试过; xdebug.org/wizard 但制作失败。
    最近更新 更多