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

1

8

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?

Doodlesack answered 13/8, 2012 at 18:36 Comment(2)
Sorry, still nothing new here. I even took the time to format and reinstall mac os x, but it didn't help.Doodlesack
When I tried to download and install the Xcode Command Line Tools from the Preferences pane. And after that created the symlink ("sudo ln -s /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain"), it would install again. But now I have the problem that x-sendfile doesn't seem to be loaded after a restart. No error, nothing. But "LoadModule xsendfile_module libexec/apache2/mod_xsendfile.so" has been added to the httpd.conf. Hmm... wierd.Doodlesack
P
9

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.

Phip answered 18/11, 2013 at 7:58 Comment(2)
Sir, you just saved me hours of headache. Here is my +1. Please take it :)Tequilater
This is also still relevant for High Sierra.Ratchet

© 2022 - 2024 — McMap. All rights reserved.