php
PopularGeneral-purpose scripting language
About
Install php on macOS with Homebrew Formula using `brew install php`. php is a Utilities command-line package with version 8.5.9. The package is listed in homebrew/core.
brew install php
Dependencies
Build Dependencies
Installation Notes
To enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php_module $HOMEBREW_PREFIX/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:
$HOMEBREW_PREFIX/etc/php/8.5/
Official Homebrew Stats
Install activity metrics for php.
Frequently asked questions
How do I install php with Homebrew?
Run brew install php in Terminal to install php as a Homebrew formula on macOS.
What kind of package is php?
php is a Utilities Homebrew formula and FastBrew currently shows version 8.5.9.
What should I review before installing php?
Review the runtime dependencies (apr, apr-util, argon2, autoconf, curl, freetds, gd, gmp, icu4c@78, libpq, libsodium, libzip, net-snmp, oniguruma, openldap, openssl@3, pcre2, sqlite, tidy-html5, unixodbc, gettext) and build dependencies (httpd, pkgconf) along with any caveats before installing.
Related Utilities Apps
View allInterpreted, interactive, object-oriented programming language