# philcook/brew-php-switcher

Brew PHP switcher is a simple shell script to switch your apache and CLI quickly between major versions of PHP. If you support multiple products/projects that are built using either brand new or old legacy PHP functionality. For users of Homebrew (or brew for short) currently only.

Repository: https://github.com/philcook/brew-php-switcher
Canonical: https://ross.abutalabs.com/products/brew-php-switcher
Language: Shell
License: MIT
License Family: permissive
Topics: homebrew, php, shell
Last push: 2026-07-15T09:19:08+00:00

## Health v2 (maintenance only)
Score: 64/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 92, release rhythm 8, longevity 100
- inputs: {"age_days": 4557, "days_push": 49, "days_rel": 642, "gap_med": null, "n_releases_24m": 1}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1007, forks 92 (observed 2026-08-28T04:03:12.292787+00:00)

## What it is
A simple shell script for macOS Homebrew users that switches PHP versions for both Apache and CLI with a single command, automatically rewriting the Apache module configuration. It supports PHP 5.6 through 8.5 and can also switch or skip Laravel Valet configuration.

## Use cases
- switch php versions on mac with homebrew
- change apache and cli php version in one command
- manage multiple php versions across legacy and new projects
- stop editing apache config manually when switching php
- switch php version for laravel valet
- switch between php 7.4 and php 8.x locally

## When to choose
- you are on macOS and installed PHP via Homebrew
- you support multiple projects that require different major PHP versions
- you want Apache and Valet configs updated automatically when switching PHP
- you want a single-command alternative to editing httpd.conf by hand

## When to avoid
- you are on Linux or Windows rather than macOS
- your PHP is installed from source or a non-Homebrew package manager
- you run Nginx instead of Apache since only Apache and Valet configs are handled
- you need per-project PHP version pinning rather than machine-wide switching

## Facets
- artifact type: cli-tool
- maturity: active
- function: cli, configuration-management, developer-tools
- domain: developer-tools, web-development
- platform: cli
- tags: homebrew, php, version-switcher, shell-script, apache, valet, macos, php-versions, command-line

## Member repositories
- philcook/brew-php-switcher (main) score 64

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:12.292787+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:12:32.324244+00:00, confidence not recorded.
  - readme: https://github.com/philcook/brew-php-switcher (fetched 2026-08-28T04:03:12.292787+00:00, sha 1a58aa2ce9ba)
- Data as of 2026-08-30T08:39:29.467469+00:00.
