Oct 27, 2016

Apache not loading PHP after SierraOS upgrade (Homebrew way)

Had a hard time dealing with Apache Server + PHP on my Mac right after SierraOS upgrade.

I use homebrew to get my Mac run with latest PHP7 version instead of directly messing around with the original library come with the SierraOS.

Firstly, the latest update of homebrew, PHP module has no longer installed with Apache.
You need:
brew install php70 --with-apache
in order to download the PHP with libphp7.so 
(this is the file you need when you use apache to load php module)

2nd, after you have Apache downloaded with your PHP through homebrew.
All the manual configurations, by default,
have to be done inside /usr/local/etc/apache2/2.4 (yours might be 2.2, based on your installed version).
Remember those httpd.conf, httpd-vhost.conf, etc... they're all inside the /usr/local/etc/apache2/2.4 folder?

and add a missing media type to your mime_module which it's the most obscure step (to a beginner like me) to missed out during configuration.
AddType application/x-httpd-php .php
Symptom check (whether or not to add the line above):
- php module is loaded correctly, but plain php code still showing in your localhost, for instance, php_info() doesn't work

- your sudo apachectl configtest show nothing wrong "Syntax OK"