Installing xdebug on MacOs Mojave - 'php.h' file not found

 ̄綄美尐妖づ 提交于 2019-11-27 12:17:03

问题


I try to install xdebug on MacOs Mojave but get this error

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

Command Line Tools are installed.


回答1:


I ran into this trying to compile xdebug on my system, I had to do the following to get it to work

1) (Re)install the command line tools (I had installed them at one point, but the files under /Library/Developer/CommandLineTools/ were missing so I must have deleted it...)

xcode-select --install

2) Reinstall the header files

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

Credit to @donatJ - https://stackoverflow.com/a/52612102/649915




回答2:


Headers aren't installed for Mojave.

To install the headers:

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

I was having the same issue and this fixed it for me.




回答3:


brew doctor

and then

brew link --overwrite php

helped me.



来源:https://stackoverflow.com/questions/52623108/installing-xdebug-on-macos-mojave-php-h-file-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!