如何修复 Homestead 上 Xdebug 的编译错误

How to fix this compile error for Xdebug on Homestead

我无法在 Homestead 上安装 Xdebug,因为我遇到了某种编译错误。

我正在使用 Xdebug 向导 (https://xdebug.org/wizard),当我输入 ./configure 命令时出现此错误:

configure: error: in /home/vagrant/code/xdebug-2.7.2:
configure: error: cannot run C compiled programs.
If you meant to cross compile, use '--host'.
See 'config.log' for more details

这表明您根本没有安装 C 编译器。首先安装 php-dev 包后你会好运,它应该引入 PHP 扩展需要的编译器。