🍺 BREW Explorer

← all formulae

brew-php-switcher

brew install brew-php-switcher v2.6 MIT

Switch Apache / Valet / CLI configs between PHP versions

94
30-day installs · #3564
330
90-day · #3394
2.1k
365-day · #2777
1.0k
★ GitHub stars · updated 9mo ago

GitHub topics

homebrew php shell

Links

Raw metadata
{
  "aliases": [],
  "alternatives": [],
  "build_dependencies": [],
  "categories": [],
  "caveats": null,
  "conflicts_with": [],
  "dependencies": [],
  "deprecated": 0,
  "deprecation_reason": null,
  "desc": "Switch Apache / Valet / CLI configs between PHP versions",
  "disable_reason": null,
  "disabled": 0,
  "enrichment_fetched_at": "2026-06-20T23:35:59+00:00",
  "first_seen": "2026-06-20T23:34:18+00:00",
  "full_name": "brew-php-switcher",
  "github_default_branch": "master",
  "github_last_commit_at": "2025-11-25T05:09:40Z",
  "github_readme_excerpt": "Brew PHP Switcher [![CI](https://github.com/philcook/brew-php-switcher/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/philcook/brew-php-switcher/actions/workflows/ci.yml)\n=========\n\nBrew PHP switcher is a simple script to switch your Apache and CLI configs quickly between major versions of PHP.\n\nIf you support multiple products/projects that are built using either brand new or old legacy PHP functionality and you find it a pain to change config files continually this will make the whole process just one command.\n\nCaveats\n-------\n\nFor users of OSX only who have installed PHP via [Homebrew] and for PHP version 5.6, 7.0, 7.1, 7.2, 7.3, 7.4 and 8.0 only.\n\nYour Apache config must have native osx PHP module commented out.\n```sh\n#LoadModule php5_module libexec/apache2/libphp5.so\n```\n\nBrew PHP Switcher will automatically add the [Homebrew]\u0027s PHP module location in the Apache config in the following format.\n```sh\n#LoadModule php5_module /usr/local/opt/php@5.6/lib/httpd/modules/libphp5.so\n#LoadModule php7_module /usr/local/opt/php@7.0/lib/httpd/modules/libphp7.so\n#LoadModule php7_module /usr/local/opt/php@7.1/lib/httpd/modules/libphp7.so\n#LoadModule php7_module /usr/local/opt/php@7.2/lib/httpd/modules/libphp7.so\n#LoadModule php7_module /usr/local/opt/php@7.3/lib/httpd/modules/libphp7.so\n#LoadModule php7_module /usr/local/opt/php@7.4/lib/httpd/modules/libphp7.so\n#LoadModule php7_module /usr/local/opt/php@8.0/lib/httpd/modules/libphp8.so\n```\n\nVersion\n----\n\n2.3\n\nInstallation\n--------------\n```sh\nbrew install brew-php-switcher\n```\n\nWhere **5.6** exists, please replace with syntax of **5.6**, **7.0**, **7.1**, **7.2**, **7.3**, **7.4**, **8.0**, **8.1**, **8.2**, **8.3** or **8.4** depending on which version is required.\n```sh\nbrew-php-switcher 5.6\n```\n\n\u003e by default will switch apache config\n\nOptions\n--------------\n\n- `-s|-s=*` Skips apache \u0026 valet config switch for i.e\n\n```sh\n# skip apache only\nbrew-php-switcher 5.6 -s\n\n# skip valet only\nbrew-php-switcher 5",
  "github_repo": "philcook/brew-php-switcher",
  "github_stars": 1006,
  "github_topics": [
    "homebrew",
    "php",
    "shell"
  ],
  "homepage": "https://github.com/philcook/brew-php-switcher",
  "homepage_og_description": null,
  "homepage_og_image": null,
  "homepage_title": null,
  "installs_30d": 94,
  "installs_365d": 2082,
  "installs_90d": 330,
  "keg_only": 0,
  "keg_only_reason": null,
  "last_seen": "2026-06-20T23:34:18+00:00",
  "license": "MIT",
  "llm_generated_at": null,
  "llm_model": null,
  "name": "brew-php-switcher",
  "oldnames": [],
  "one_liner": null,
  "optional_dependencies": [],
  "rank_30d": 3564,
  "rank_365d": 2777,
  "rank_90d": 3394,
  "raw_hash": "9586e194a7be8fa4",
  "recommended_dependencies": [],
  "revision": 0,
  "ruby_source_path": "Formula/b/brew-php-switcher.rb",
  "tap": "homebrew/core",
  "test_dependencies": [
    "php"
  ],
  "uses_from_macos": [],
  "version_head": "HEAD",
  "version_stable": "2.6",
  "versioned_formulae": [],
  "why_use_this": null
}