Tips and tricks

How to create a local dev Apache Mysql PHP Setup on Mac OS X ‣ Digital Zoom Studio
brew unlink php && brew link --overwrite --force php@8.0
add this in your conf file inside apache configuration ( use /opt/homebrew/bin/httpd -V to find the configuration file )
remember to uncomment LoadModule rewrite_module libexec/apache2/mod_rewrite.so and add AddType application/x-httpd-php .php
if you are not allowed to add modules -> create signing authority -> create code signing authority ->
codesign --sign "Mohd Shakir" --force --keychain ~/Library/Keychains/login.keychain-db /opt/homebrew/opt/php/lib/httpd/modules/libphp.so
make sure DirectoryIndex includes php

Frequently Asked Questions
php config
get php ini config files names
php --ini
you can for example first edit the config
upload_max_filesize = 32M
post_max_size = 34M
max_input_vars = 2000
restart php after config change
if you have it from homebrew you can just
brew services restart php
It’s recommended you install PHP-FPM
==> 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.4/
To start php now and restart at login:
brew services start php