In a new post to his site Jason McCreary has posted an update to his previous "installing Apache, MySQL and PHP" post with a few changes for macOS Sierra. The changes don't make the installation too much different, however.
Mac OS X runs atop UNIX. So most UNIX software installs easily on Mac OS X. Furthermore, Apache and PHP come packaged with OS X. To create a local web server, all you need to do is configure Apache and install MySQL.
I am aware of the web server software available for Mac OS X, notably MAMP. These get you started quickly. But they forego the learning experience and, as most developers report, can become difficult to manage.
He walks you through the process of getting Apache up and running and the current version of PHP configured and working with it. He shows how to verify PHP is working as expected, how to install the DMG of MySQL and make it also work happily with the PHP installation. There's also a bit at the end you can enable to add in some additional Apache module support for mod_rewrite, mod_expires and mod_deflate.