在 MacOs Mojave 上安装 xdebug - 找不到"php.h"文件



>我尝试在MacOS Mojave上安装xdebug,但收到此错误

/private/tmp/pear/install/xdebug/xdebug.c:25:10: fatal error: 'php.h' file not found

安装了命令行工具。

我在尝试在我的系统上编译 xdebug 时遇到了这个问题,我必须执行以下操作才能让它工作

0( 检查您的系统上是否有文件/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg。

1(如果没有,请安装命令行工具(我曾经安装过它们,但是/Library/Developer/CommandLineTools/下的文件丢失了,所以我必须删除它...

xcode-select --install

2( 重新安装头文件

sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /

信用@donatJ - https://stackoverflow.com/a/52612102/649915

brew doctor

然后

brew link --overwrite php

帮助了我。

Mojave 未安装标头。

要安装标头:

open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

我遇到了同样的问题,这为我解决了它。

最新更新