Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fatal error: 'apr.h' file not found when installing x-sendfile mac os x mountain lion server

When I upgraded my Lion Server to Mountain Lion, it seems that it removed my mod_xsendfile from apache.

I followed the instructions from this web site, but got stuck with a "No such file or directory" error. With some help from google i found this page that gave me the solution to this: "sudo ln -s /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/ /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain"

Looked good, but when I try to run "sudo apxs -cia mod_xsendfile.c" I get a "fatal error: 'apr.h' file not found" error.

Any ideas?

like image 706
einord Avatar asked Aug 13 '12 18:08

einord


1 Answers

You need to re-install the Xcode command line tools:

xcode-select --install

You'll then likely need to accept the Xcode license agreement again:

sudo xcodebuild -license

Once you've done that (as well as your symlink for the toolchain) you should be good to go.

like image 91
Sam Sehnert Avatar answered Nov 06 '22 01:11

Sam Sehnert