FORMULAv8.1.34Deprecated
php@8.1 for macOS
General-purpose scripting language
Installation on macOS (Apple Silicon & Intel)
brew install php-8.1
Package Metadata
| Identifier | php-8.1 |
|---|---|
| Current Version | 8.1.34 |
| Tap Repository | homebrew/core |
| License | PHP-3.01 |
| Upstream Homepage | https://www.php.net/ |
| Last Verified | 2026-11-26T14:43:31Z |
Runtime Dependencies (22)
apr apr-util argon2 aspell autoconf curl freetds gd gmp icu4c@79 krb5 libpq libsodium libzip oniguruma openldap openssl@4 pcre2 sqlite tidy-html5 unixodbc gettext
Build Dependencies (2)
Engineering Caveats
To enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php_module $HOMEBREW_PREFIX/opt/php@8.1/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:
$HOMEBREW_PREFIX/etc/php/8.1/Related macOS Packages
php@8.2General-purpose scripting languagephp-cs-fixerTool to automatically fix PHP coding standards issuesphp@8.3General-purpose scripting languagephp-code-snifferCheck coding standards in PHP, JavaScript and CSSphpGeneral-purpose scripting languagephp@8.4General-purpose scripting languagephotocraft-cliHeadless PhotoCraft engine to convert, inspect and batch-edit imagesphp@8.5General-purpose scripting language