PHP not working on Apache2 Server

I was working on my MacOS and apache was not executing PHP. It took me a hot minute but I came across a working solution on StackOverflow. Here is the link to the solution for posterity: https://stackoverflow.com/questions/38010854/phpinfo-not-working-on-mac-os-x-capitan-apache2-server.

The short version of the long answer on that page is:

Simply needed to enable php in apache:
sudo nvim /etc/apache2/httpd.conf
uncomment the following line
#LoadModule php7_module libexec/apache2/libphp7.so
then restart apache
sudo apachectl restart