# 使用 Homebrew 安装 brew-php-switcher

查看 brew-php-switcher 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:brew-php-switcher
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install brew-php-switcher
```

  证据: local Homebrew formula metadata

## 软件包事实

- **软件包键:** brew:brew-php-switcher
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/brew-php-switcher>
- **版本:** 2.6
- **来源摘要:** Switch Apache / Valet / CLI configs between PHP versions
- **主页:** <https://github.com/philcook/brew-php-switcher>
- **仓库:** <https://github.com/philcook/brew-php-switcher>
- **上游文档:** <https://github.com/philcook/brew-php-switcher#readme>
- **许可证:** MIT
- **源码归档:** <https://github.com/philcook/brew-php-switcher/archive/refs/tags/v2.6.tar.gz>
- **已生成:** 2026-07-08T07:18:31+00:00

## 可执行文件

- brew-php-switcher (cli)
- phpswitch.sh (cli)
- brew-php-switcher (别名)
- phpswitch.sh (别名)

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 all

## 版本和新鲜度

- 页面生成时间: 2026-07-08
- 管理器版本: 2.6
- 本地数据: OK
- 上游仓库: https://github.com/philcook/brew-php-switcher
- 检测到的最新版本: v2.6 (当前)
- 信息: No package-manager update timestamp was available.
## 项目历史与用法

Brew PHP Switcher is a macOS shell utility for switching Homebrew-installed PHP versions across command-line, Apache, and Valet-oriented development setups.

### 项目历史

The project was created in March 2014 and published v1.0 in April 2014. Its README frames the tool as a one-command answer for developers supporting multiple PHP projects that require different PHP major versions.

The script tracks Homebrew PHP layout changes over time. The README documents support for older PHP 5.6 and 7.x versions through modern 8.x versions, and recent commits mention Apple Silicon Homebrew Apache path handling.

### 采用历史

The package gained a durable niche among macOS PHP developers because it automated edits that were otherwise easy to get wrong: Apache module lines, CLI symlinks, and optional Valet configuration. GitHub metadata shows over a thousand stars, and Homebrew analytics reported thousands of installs over the prior year at lookup time.

### 使用方式

Users install it with Homebrew and run commands such as `brew-php-switcher 8.3` or `brew-php-switcher 5.6`. Options allow skipping Apache or Valet changes, or targeting only a specific config area.

### 为什么软件包爱好者会关心

The package is a classic Homebrew-era local development helper: small shell code wrapped as a formula, solving the impedance mismatch between language runtime versions and macOS web-server configuration. It is historically tied to the long tail of PHP projects that require multiple runtime versions on one laptop.

### 时间线

- 2014: Repository created and v1.0 released.
- 2019: v2.2 released during the PHP 7.x Homebrew era.
- 2021: v2.4 released with continued PHP version updates.
- 2024: v2.6 released.
- 2026: Homebrew stable version reported as 2.6.

### Related projects

- Homebrew PHP formulae are the runtime packages switched by the tool.
- Apache configuration is one of the script's central targets.
- Valet configuration is supported through skip and target options documented in the README.

### 来源

- <https://formulae.brew.sh/api/formula/brew-php-switcher.json>
- <https://github.com/philcook/brew-php-switcher>
- <https://raw.githubusercontent.com/philcook/brew-php-switcher/master/README.md>


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals

## 源数据库详情

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** brew-php-switcher
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable


## 相关链接

- [Source-control packages](https://www.automicvault.com/zh-hans/pkg/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://www.automicvault.com/zh-hans/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/zh-hans/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://www.automicvault.com/zh-hans/pkg/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [ndenv](https://www.automicvault.com/zh-hans/pkg/brew/ndenv/) - Shares av.db curated category or tags: cli, developer-tools, runtime-management.
- [node-build](https://www.automicvault.com/zh-hans/pkg/brew/node-build/) - Shares av.db curated category or tags: cli, developer-tools, runtime-management.
- [ant](https://www.automicvault.com/zh-hans/pkg/brew/ant/) - Shares av.db curated category or tags: apache, cli, developer-tools.
- [apache-opennlp](https://www.automicvault.com/zh-hans/pkg/brew/apache-opennlp/) - Shares av.db curated category or tags: apache, cli, developer-tools.
- [apr](https://www.automicvault.com/zh-hans/pkg/brew/apr/) - Shares av.db curated category or tags: apache, cli, developer-tools.
- [apr-util](https://www.automicvault.com/zh-hans/pkg/brew/apr-util/) - Shares av.db curated category or tags: apache, cli, developer-tools.
- [bb-cli](https://www.automicvault.com/zh-hans/pkg/brew/bb-cli/) - Shares av.db curated category or tags: cli, developer-tools, php.
- [brew-gem](https://www.automicvault.com/zh-hans/pkg/brew/brew-gem/) - Shares av.db curated category or tags: cli, developer-tools, homebrew.

## Combined YAML source

View the package source record on GitHub. [combined/brew-php-switcher.yml](https://github.com/automic-vault/db/blob/main/combined/brew-php-switcher.yml)


## 来源

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- cross-ecosystem install command graph
