Apple macOS comes with Apache and PHP already installed, however Apache and using PHP with it is not enabled by default. This tutorial provides an overview of some of the key tasks related to enabling Apache and PHP; however the needed steps for each version of macOS can vary greatly so you’ll likely want to visit many pages on this topic.
Because PHP is already installed you can use the PHP Built-in Web Server for local development and then there is no need for a complex Apache setup. For info on how to do this see Use Visual Studio Code for PHP Development or Use GitHub Atom Editor for PHP Development.
Recommended Apache, PHP, and MySQL Install Resources for macOS