Skip to content

Instantly share code, notes, and snippets.

@locvfx
Created October 15, 2024 13:54
Show Gist options
  • Save locvfx/47112184ff99a370a563a9c9c02a8b42 to your computer and use it in GitHub Desktop.
Save locvfx/47112184ff99a370a563a9c9c02a8b42 to your computer and use it in GitHub Desktop.
brew php
To enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php_module /opt/homebrew/opt/php/lib/httpd/modules/libphp.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:
/opt/homebrew/etc/php/8.3/
To 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:
/opt/homebrew/opt/php/sbin/php-fpm --nodaemonize
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment