I'm trying to get off of MAMP and run local versions of an AMP stack on my Mac, but when I try to start apache and run localhost from a browser, it's not coming up with anything.

In running apachectl configtest, I see the following errors, but I don't know how to fix.

Is there a way to do a clean reinstall of the AMP stack on a Mac? Is this even the recommended fix?

httpd: Syntax error on line 527 of /private/etc/apache2/httpd.conf: Syntax error on line 8 of /private/etc/apache2/other/+php-osx.conf: Cannot load /usr/local/php5/libphp5.so into server: dlopen(/usr/local/php5/libphp5.so, 10): Symbol not found: _unixd_config\n Referenced from: /usr/local/php5/libphp5.so\n Expected in: /usr/sbin/httpd\n in /usr/local/php5/libphp5.so

  • Could you expand your question with the versions of Apache and PHP you have installed? Is it the ones that came with your Mac or have you installed others? Also could you tell us line 527 of httpd.conf and line 8 of +php-osx.conf (ideally with a few lines of context on either side of both)? Commented Dec 8, 2015 at 0:34

1 Answer 1


Looks like you have an extra conf file in the other directory. This file (+php-osx.conf) is trying to load PHP from /usr/local, rather than the system-supplied PHP. I know my PHP install works and am using the bog-standard Apple supplied Apache and PHP. Call to PHP module should be in the main httpd.conf file - this line is there, but commented out, by default in the Apple-supplied config:

LoadModule php5_module libexec/apache2/libphp5.so

And in other there should only be the single php5.conf file, contents:

<IfModule php5_module>
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps

    <IfModule dir_module>
        DirectoryIndex index.html index.php

The Apple-provided Apache2 should include the default config files in /etc/apache2, labeled with a suffix such as .original, .pre-update, or ~previous. Same goes for the conf files in subdirectories.

  • Hi @dr.nixon, and thank you for the answer. I had someone look at the problem last night, and — as you point out — there's a mix of configurations. However, the problem is so bad it's unrecoverable, so I'll need to go down to the MAMP route. Commented Apr 13, 2016 at 11:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .