Space Cat, Prince Among Thieves

Fix Missing Headers Compiling on macOS Mojave

While trying to compile PHP extensions after installing macOS Mojave, I was butting up against a ton of missing header file errors including php.h and zlib.

After several hours of beating my head against my desk and Googling/Stack Overflowing I found the solution.

Ends up you just need to force re-install the header files. Special thanks to @sfdye for the solution!

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

If you get an error about that file not existing, you probably simply don't have the Xcode command line tools installed which can be remedied simply as follows:

$ xcode-select --install

Read More / Comment »

Recent Comments

Большое спасибо

Mojave installation messes up some peoples header files for some unknown reason. You can pretty easily reinstall them following my post here.

Is this still up to date? I don't observe the round-trip problem described here in Excel for Mac 16.19. When I open a file in CSV UTF-8-with-BOM, edit it, save …

after running make cmd, getting this error /tmp/php-7.1.19/ext/mcrypt/mcrypt.c:25:10: fatal error: 'php.h' file not found how to solve this one? please h…

Thank you so much. You saved my working time too much.