To enable any packages or to run PHP from apache
$ sudo vi /private/etc/apache2/httpd.conf
If PHP scripts are not executing, first check if the relevant version of the PHP module is enabled in httpd config settings (somewhere in the middle of the file). You may need sudo permission to save any file settings.
LoadModule php7_module libexec/apache2/libphp7.so
Then, restart the server
$ sudo apachectl -k restart