Skip to content

Instantly share code, notes, and snippets.

@cheh
Created December 5, 2018 18:32
Show Gist options
  • Save cheh/154dff9d3975777218912aceb76b22c7 to your computer and use it in GitHub Desktop.
Save cheh/154dff9d3975777218912aceb76b22c7 to your computer and use it in GitHub Desktop.
==> php
To enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php7_module /usr/local/opt/php/lib/httpd/modules/libphp7.so
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
Finally, check DirectoryIndex includes index.php
DirectoryIndex index.php index.html
The php.ini and php-fpm.ini file can be found in:
/usr/local/etc/php/7.2/
To have launchd start php now and restart at login:
brew services start php
Or, if you don't want/need a background service you can just run:
php-fpm
========
DocumentRoot is /usr/local/var/www.
The default ports have been set in /usr/local/etc/httpd/httpd.conf to 8080 and in
/usr/local/etc/httpd/extra/httpd-ssl.conf to 8443 so that httpd can run without sudo.
To have launchd start httpd now and restart at login:
brew services start httpd
Or, if you don't want/need a background service you can just run:
apachectl start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment