【问题标题】:Cannot load Xdebug, as PHP was built with API NTS debug无法加载 Xdebug,因为 PHP 是使用 API NTS 调试构建的
【发布时间】:2017-01-27 13:25:40
【问题描述】:

我使用brew安装了php70和php70-xdebug。

brew install php70
brew install php70-xdebug

php -v 返回此错误:

无法加载 Xdebug - 它是使用配置 API320151012、NTS 构建的, 而运行引擎是 API320151012,NTS,debug

我不知道如何将--disable-debug 传递给编译器,brew 使用预配置公式 (https://github.com/Homebrew/homebrew-php),并且不允许设置此选项。

问题是:xdebug公式有--disable-debug,而php70公式有一个选项--with-debug,但是即使你不使用这个参数,它也会在configure命令后附加--enable-debug

【问题讨论】:

    标签: macos homebrew xdebug php-7


    【解决方案1】:

    我找到了一种解决方法,它并不完美,但它确实有效!

    1. 使用brew edit php70-xdebug 编辑公式并将--enable-debug 添加到配置命令中:

      system "./configure", "--prefix=#{prefix}",
                        phpconfig,
                        "--disable-dependency-tracking",
                        "--enable-xdebug",
                        "--enable-debug"
      
    2. 重新编译库

      brew reinstall php70-xdebug --build-from-source
      

    php70-opcache 也同样适用。

    【讨论】:

      猜你喜欢
      • 2023-01-11
      • 2021-03-10
      • 2021-12-14
      • 1970-01-01
      • 2022-01-22
      • 2013-06-17
      • 2015-06-14
      • 1970-01-01
      • 2021-07-02
      相关资源
      最近更新 更多