Every time Apple releases a major OS it seems to break my web development, so I switched my setup to use Brew which made things even more confusing –at first.
The folder locations might be a little different for you, but the point is: I was editing the wrong file and seeing no results.
Here are a few things to keep in mind when debugging your system issues:
1. There are two instances of Apache if you used brew (one from Apple, and one from Brew), and each is started differently
Brew: sudo brew services restart httpd
macOS: sudo apachectl -k restart
2. This also means I was looking at wrong httpd.conf files, there are multiple ones:
Brew: /usr/local/etc/httpd/httpd.conf
macOS: private/etc/apache2/httpd.conf
3. I also have different installation of php libraries now that I switched to Brew
(installed with brew install php@7.3
)
Brew: /usr/local/etc/php/7.3/php.ini
macOS: /Library/Server/Web/Config/php/php.ini
Apple overwrites your httpd.conf
file when upgrading the system, but it saves an old version, you just have to rename it.
Great instructions how to setup Apache on Mac using Brew ->
Setup Apache on Mac
Another good article how to Setup apache and php on macOS Mojave -> Apache on Mojave with multiple versions