php

Popular
Formula Utilities v8.5.9

General-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.

Install 1 App in Terminal
$
brew install php
Source: homebrew/core Website Homebrew

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.

-1.5% vs 90d avg
30 Days
25.8K total installs
859 installs / day avg
90 Days
78.5K total installs
872 installs / day avg
1 Year
370.7K total installs
1.0K installs / day avg

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 all
Open xz
xz
Popular

General-purpose data compression with high compression ratio

formula Utilities v5.8.3
Open python@3.14
python@3.14
Popular

Interpreted, interactive, object-oriented programming language

formula Utilities v3.14.7
Open gh
gh
Popular

GitHub command-line tool

formula Utilities v2.98.0
Open readline
readline
Popular

Library for command-line editing

formula Utilities v8.3.3
Open zstd
zstd
Popular

Zstandard is a real-time compression algorithm

formula Utilities v1.5.7
Open glib
glib
Popular

Core application library for C

formula Utilities v2.88.3