Installing Mod Perl on the macOS Sierra Homebrew Version of Apache 2.4.xx

Written by James McDonald

April 16, 2017

Do this

svn checkout mod_perl-2.0

cd mod_perl-2.0

perl Makefile.PL MP_APXS=/usr/local/Cellar/httpd24/2.4.25/bin/apxs

# this doesn't do anything but it tells you where 
# apxs will put
/usr/local/Cellar/httpd24/2.4.25/bin/apxs -q LIBEXECDIR


# this will fail when trying to start httpd
# but mod_perl still seems to work
make test 

make install

brew services restart httpd24

To Test
Create a file with perl in it and copy to a cgi-bin directory in your website…

#!/usr/bin/env perl

print "\n\n";

print "Hello world\n";

You may have to run cpan and install missing modules when you start using mod_perl check your Apache access.log or error.log


  1. GiDi

    I hope, you can help me:

    perl Makefile.PL MP_APXS=/usr/local/Cellar/httpd24/2.4.25/bin/apxs

    Here I get a error:

    [ error] Unable to determine server version, aborting.
    [ error] Invalid MP_APXS specified?

    I have yesterday installed with HOMEBREW httpd24/2.4.33
    Too other Version 2.4.33 gives error!

    • James

      What does httpd -v say and what does which httpd


Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…