Mac apache not working - apachectl configtest errors

Solution 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
    </IfModule>
</IfModule>

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.