

Accessing ports with numbers lower than 1024 require root privileges and so, listening on port 8080 lets users run Apache without being root. This line tells Apache to listen for traffic on the port 8080. In this file, there are a few changes to make: Listen 8080 In my case, the main Apache configuration file is located at /opt/homebrew/etc/httpd/nf (again, on an Intel-based Mac, this is likely to be /usr/local/etc/httpd/nf). Next, let’s get to work on the actual Apache configuration. We'll look at how to set up a local development environment using these and, as usual, we’ll try to cover the “why” as well as the “what” in addition to just presenting the configuration, we'll go over the purpose of each directive and command. Instead of using the built-in versions, we’ll install Apache and PHP using Homebrew. Finally, running php -v to check the version of the built-in PHP gives a warning message stating that PHP will be removed from future versions of macOS - in fact, in the upcoming macOS Monterey, PHP seems to be gone. I’ve had problems where OS updates have overwritten my configuration for the built-in Apache server. We don’t have control over the exact versions used, and the version available might not be up to date. However, there are a few drawbacks with this approach.


MacOS comes with built-in versions of Apache and PHP, and we could easily use those.
