PHP on macOS
caveats

==> Caveats

 

https://www.php.net/manual/en/install.macosx.packages.php

To enable PHP in Apache add the following to httpd.conf and restart Apache: LoadModule php_module /usr/local/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:
/usr/local/etc/php/8.2/

To start php now and restart at login:

  brew services start php

==> Summary

🍺  /usr/local/Cellar/php/8.2.3: 519 files, 81.7MB

==> Running brew cleanup php...

Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.

Hide these hints with HOMEBREW_NO_ENV_HINTS (see man brew).

==> Caveats

==> php

To enable PHP in Apache add the following to httpd.conf and restart Apache:

    LoadModule php_module /usr/local/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: /usr/local/etc/php/8.2/

To start php now and restart at login:

brew services start php



❯ brew services start php
==> Tapping homebrew/services
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-services'...
remote: Enumerating objects: 2387, done.
remote: Counting objects: 100% (38/38), done.
remote: Compressing objects: 100% (28/28), done.
remote: Total 2387 (delta 15), reused 23 (delta 9), pack-reused 2349
Receiving objects: 100% (2387/2387), 660.32 KiB | 5.37 MiB/s, done.
Resolving deltas: 100% (1079/1079), done.
Tapped 1 command (45 files, 827.2KB).
==> Downloading https://formulae.brew.sh/api/formula.jws.json

==> Successfully started `php` (label: homebrew.mxcl.php)

Scroll to Top