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

后端 未结 3 1317
北荒
北荒 2020-12-13 14:45

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


        
相关标签:
3条回答
  • 2020-12-13 15:09

    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.

    0 讨论(0)
  • 2020-12-13 15:17
    brew doctor
    

    and then

    brew link --overwrite php
    

    helped me.

    0 讨论(0)
  • 2020-12-13 15:30

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

    0) Check that you have the file /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg on your system.

    1) If not, 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

    0 讨论(0)
提交回复
热议问题