🍺 BREW Explorer

← all formulae

php

brew install php v8.5.7 PHP-3.01 AND Zend-2.0 AND BSL-1.0 AND MIT AND Apache-1.0 AND Apache-2.0 AND bcrypt-Solar-Designer AND BSD-2-Clause-Darwin AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC AND ISC AND LGPL-2.1-only AND LGPL-2.1-or-later AND OLDAP-2.8 AND TCL AND Zlib

General-purpose scripting language (v8.5.7) for web development, CLIs, and server-side applications.

Why you might care

PHP remains the dominant server-side web language, powering Laravel, Symfony, and WordPress ecosystems. Use this for running PHP applications locally, development servers, or as a shebang interpreter for scripts. Homebrew's formula includes standard extensions (curl, pdo, gd, openssl) and is more customizable than system PHP.

Categories

Alternatives

Node.js Python Ruby
26.6k
30-day installs · #199
80.5k
90-day · #212
393.4k
365-day · #176

Runtime dependencies

Build dependencies

Links

Caveats

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/

Blurb generated by claude-haiku-4-5 on today.

Raw metadata
{
  "aliases": [
    "php@8.5"
  ],
  "alternatives": [
    "Node.js",
    "Python",
    "Ruby"
  ],
  "build_dependencies": [
    "httpd",
    "pkgconf"
  ],
  "categories": [
    "language-runtime",
    "interpreter",
    "web-server"
  ],
  "caveats": "To enable PHP in Apache add the following to httpd.conf and restart Apache:\n    LoadModule php_module $HOMEBREW_PREFIX/opt/php/lib/httpd/modules/libphp.so\n\n    \u003cFilesMatch \\.php$\u003e\n        SetHandler application/x-httpd-php\n    \u003c/FilesMatch\u003e\n\nFinally, check DirectoryIndex includes index.php\n    DirectoryIndex index.php index.html\n\nThe php.ini and php-fpm.ini file can be found in:\n    $HOMEBREW_PREFIX/etc/php/8.5/\n",
  "conflicts_with": [],
  "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"
  ],
  "deprecated": 0,
  "deprecation_reason": null,
  "desc": "General-purpose scripting language",
  "disable_reason": null,
  "disabled": 0,
  "enrichment_fetched_at": "2026-06-20T23:40:44+00:00",
  "first_seen": "2026-06-20T23:34:18+00:00",
  "full_name": "php",
  "github_default_branch": null,
  "github_last_commit_at": null,
  "github_readme_excerpt": null,
  "github_repo": null,
  "github_stars": null,
  "github_topics": [],
  "homepage": "https://www.php.net/",
  "homepage_og_description": "PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world.",
  "homepage_og_image": "https://www.php.net/images/meta-image.png",
  "homepage_title": "PHP",
  "installs_30d": 26601,
  "installs_365d": 393400,
  "installs_90d": 80460,
  "keg_only": 0,
  "keg_only_reason": null,
  "last_seen": "2026-06-20T23:34:18+00:00",
  "license": "PHP-3.01 AND Zend-2.0 AND BSL-1.0 AND MIT AND Apache-1.0 AND Apache-2.0 AND bcrypt-Solar-Designer AND BSD-2-Clause-Darwin AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC AND ISC AND LGPL-2.1-only AND LGPL-2.1-or-later AND OLDAP-2.8 AND TCL AND Zlib",
  "llm_generated_at": "2026-06-20T23:43:21+00:00",
  "llm_model": "claude-haiku-4-5",
  "name": "php",
  "oldnames": [
    "php-intl"
  ],
  "one_liner": "General-purpose scripting language (v8.5.7) for web development, CLIs, and server-side applications.",
  "optional_dependencies": [],
  "rank_30d": 199,
  "rank_365d": 176,
  "rank_90d": 212,
  "raw_hash": "a89d54ca647e34b3",
  "recommended_dependencies": [],
  "revision": 0,
  "ruby_source_path": "Formula/p/php.rb",
  "tap": "homebrew/core",
  "test_dependencies": [
    "httpd"
  ],
  "uses_from_macos": [
    {
      "cyrus-sasl": "build"
    },
    "bzip2",
    "libedit",
    "libffi",
    "libxml2",
    "libxslt"
  ],
  "version_head": "HEAD",
  "version_stable": "8.5.7",
  "versioned_formulae": [
    "php@8.4",
    "php@8.3",
    "php@8.2",
    "php@8.1"
  ],
  "why_use_this": "PHP remains the dominant server-side web language, powering Laravel, Symfony, and WordPress ecosystems. Use this for running PHP applications locally, development servers, or as a shebang interpreter for scripts. Homebrew\u0027s formula includes standard extensions (curl, pdo, gd, openssl) and is more customizable than system PHP."
}