Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7751749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:37:39+00:00 2026-06-01T11:37:39+00:00

How can I install X-Sendfile apache module so that MAMP can use it? I

  • 0

How can I install X-Sendfile apache module so that MAMP can use it?

I have followed these instructions to install X-Sendfile, but it didn’t work (it seems like it just installed it for the default apache installation). I also tried to manually copy /usr/libexec/apache2/mod_xsendfile.so to /Applications/MAMP/Library/modules/, but that produced the following error when restarting Apache:

Cannot load /Applications/MAMP/Library/modules/mod_xsendfile.so into server: cannot create object file image or add library

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T11:37:40+00:00Added an answer on June 1, 2026 at 11:37 am

    naabster’s answer is correct if your MAMP binary is built for the same architecture as your kernel. The problem you’re having might be that MAMP is not built using the same architecture — I have Lion running here (10.7.3) with XAMPP 1.7.3 and I just ran across the same issue you were having.

    Here’s how I figured out what was wrong on my system, and how I fixed it. If your issue is the same as mine, then you should be able to follow along and verify as you go.

    First, here’s the output of ‘uname -a’ to show you that what I’m running:

    Darwin Tads-Mac-Pro.local 11.3.0 Darwin Kernel Version 11.3.0:
    Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64 x86_64
    

    Here are the steps I took to track down the problem and fix it:

    1. Figure out what attributes the other (working) modules had that my freshly-built xsendfile module was missing. I picked mod_headers.so as an example. The command to find that info is ‘file [filename]‘. I’m running this from a terminal cd’d to the /Applications/XAMPP/xamppfiles/modules directory:

      file mod_headers.so 
      mod_headers.so: Mach-O universal binary with 2 architectures
      mod_headers.so (for architecture i386): Mach-O bundle i386
      mod_headers.so (for architecture ppc):  Mach-O bundle ppc
      

      As you can see, XAMPP kindly provides a universal binary that supports i386 and ppc architectures. However, because the Lion kernel is running x86_64, everything I build using apxs unless I tell it to otherwise will be x86_64.

    2. Check the mach-o bundle type and architecture(s) supported by the module that was built with the recommended apxs build command (‘sudo apxs -cia mod_xsendfile.c’). Because we’re passing ‘-i’ the apxs will install the .so into the default apache modules dir … /usr/libexec/apache2…

      file /usr/libexec/apache2/mod_xsendfile.so 
      /usr/libexec/apache2/mod_xsendfile.so: Mach-O 64-bit bundle x86_64
      

      Just to double-check that this is the problem you can also look at the httpd (apache) binary:

      file /Applications/XAMPP/xamppfiles/bin/httpd
      /Applications/XAMPP/xamppfiles/bin/httpd: Mach-O universal binary with 2 architectures
      /Applications/XAMPP/xamppfiles/bin/httpd (for architecture i386):   Mach-O executable i386
      /Applications/XAMPP/xamppfiles/bin/httpd (for architecture ppc):    Mach-O executable ppc
      

      Well now, that certainly will not work with an apache instance built without an x86_64 image. Trust, but verify, eh!

    3. Now that I’m certain I understand the issue, let’s re-build the .so with the proper architecture forced on the apxs command line. To do that I’m just adding two new params, Wl (linker flags) and Wc (compiler flags). The -i means ‘install’ (move .so into the modules directory) and the -a means ‘activate’ (add or re-enable LoadModule line in the httpd.conf)

      sudo apxs -cia -Wl,"-arch i386" -Wc,"-arch i386" mod_xsendfile.c
      
    4. re-check that our new .so supports an architecture that matches the Apache installed (i386, not x86_64)

      file /Applications/XAMPP/xamppfiles/modules/mod_xsendfile.so
      /Applications/XAMPP/xamppfiles/modules/mod_xsendfile.so: Mach-O bundle i386
      

      Awesome. Now then, copy this turkey into the XAMPP install dir:

      sudo cp /usr/libexec/apache2/mod_xsendfile.so /Applications/XAMPP/xamppfiles/modules/
      

      And add the LoadModule line to the /Applications/XAMPP/xamppfiles/etc/httpd.conf.

      LoadModule xsendfile_module modules/mod_xsendfile.so
      

      You should be able to fire up the server using either the UI or the apachectl script found in the xamppfiles/bin directory.

    Hope that helps you.

    Also, I did a pretty decent due-diligence search and found just about squat looking for ‘XAMPP X-SendFile cannot create object’ in the Goog. What I did find was your question here, once I eliminated the ‘XAMPP’ since I was searching for ‘XAMPP’, not ‘MAMP’

    I started out with the ‘x’AMP stack something like 10 years back using LAMPP, then WAMPP but the ApacheFriends guys call theirs XAMPP now for all of the platforms they support. I prefer using theirs since I know if I have to set up on a Windows server I can just download the same package that I use now but for Windows and I can expect to find all of the same servers installed without (too many) surprises.


    So, just to be (very) thorough, the other way to discover these types of problems more easily is via Console.app. Open that up, filter on org.apache.httpd and you should see something similar to this:

    httpd: Syntax error on line 117 of /private/etc/apache2/httpd.conf: Cannot load
    /usr/libexec/apache2/mod_xsendfile.so into server:
    dlopen(/usr/libexec/apache2/mod_xsendfile.so, 10): no suitable image found.
    Did find:\n\t/usr/libexec/apache2/mod_xsendfile.so: mach-o, but wrong architecture
    

    You can also get that from a command line when you start the apache server manually:

    sudo apachectl -E /tmp/foo.txt -k start; tail -f /tmp/foo.txt 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any module in Orchard CMS that I can install to get a
I hear you can install a MySQL plugin, but where can I get that?
I know that I can install Jython with Java and that I can use
Normally I use: gem install rails I can install Rails on Windows, but by
is there a sharepoint home version that I can install and use for home
I wrote an app that can install and work on my development PC (a
How i can install the CDT plug-in (that you can develop in C++ under
I've got a ClickOnce application deployed that many machines can install just fine -
With the imminent release of iPhone_OS_4 is there a way I can install that
I have a situation where a user can install an older version of my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.