# 安装 php@8.2

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

## 安装

```sh
sudo av install brew:php@8.2
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install php@8.2
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install php
```

  证据: MacPorts ports tree: lang/php/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add php82
```

  证据: Alpine Linux edge package indexes: php82 from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install php
```

  证据: Debian stable package indexes: php from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install php
```

  证据: Fedora Rawhide package metadata: php from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/13ee7b80cb813542594d4235c4a0b8695435d5ecf23dd3580bc7515ae1b6180d-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#php
```

  证据: nixpkgs package indexes: php from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix

- pacman (92%):

```sh
sudo pacman -S php
```

  证据: Arch Linux sync databases: php from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

### Windows

- winget (92%):

```sh
winget install --id PHP.PHP.8.2 -e
```

  证据: Windows Package Manager source index: PHP.PHP.8.2 from https://cdn.winget.microsoft.com/cache/source.msix

- Scoop (92%):

```sh
scoop install versions/php82
```

  证据: Scoop official bucket manifest trees: bucket/php82.json from https://api.github.com/repos/ScoopInstaller/Versions/git/trees/master?recursive=1

- Chocolatey (92%):

```sh
choco install php
```

  证据: Chocolatey community package catalog: php from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','pdfsam.install'

## 软件包事实

- **软件包键:** brew:php@8.2
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/php@8.2>
- **版本:** 8.2.31
- **来源摘要:** General-purpose scripting language
- **主页:** <https://www.php.net/>
- **上游文档:** <https://www.php.net/>
- **许可证:** PHP-3.01 AND Zend-2.0 AND BSL-1.0 AND MIT AND Apache-1.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
- **源码归档:** <https://www.php.net/distributions/php-8.2.31.tar.xz>
- **更新:** 2026-05-23T15:55:44-04:00
- **生成来源:** 2026-05-26T17:25:59+00:00

## 依赖

- apr
- apr-util
- argon2
- aspell
- autoconf
- curl
- freetds
- gd
- gettext
- gmp
- icu4c@78
- krb5
- libpq
- libsodium
- libzip
- oniguruma
- openldap
- openssl@3
- pcre2
- sqlite
- tidy-html5
- unixodbc

## 构建依赖

- httpd
- pkgconf

## macOS 提供的库

- bzip2
- libedit
- libffi
- libxml2
- libxslt

## 安装行为

- post-install 钩子: 已定义
- 服务: declared
- Caveats: To enable PHP in Apache add the following to httpd.conf and restart Apache: LoadModule php_module $HOMEBREW_PREFIX/opt/php@8.2/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.2/
- Bottle: 可用 于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## 新鲜度

- 页面生成时间: 2026-05-26
- 管理器版本: 8.2.31
- 管理器更新时间: 2026-05-23
- 本地数据: ok
- 上游仓库: https://www.php.net/
- info: Release/tag comparison is only available for GitHub repositories.

## 安全说明

formula declares a Homebrew service. generalized runtime or code generation signal.

- **Geiger 风险:** orange / medium
- formula declares a Homebrew service
- generalized runtime or code generation signal

## 相关链接

- [openssl@3](https://www.automicvault.com/pkg/brew/openssl-3/) - Runtime dependency declared by Homebrew.
- [sqlite](https://www.automicvault.com/pkg/brew/sqlite/) - Runtime dependency declared by Homebrew.
- [pcre2](https://www.automicvault.com/pkg/brew/pcre2/) - Runtime dependency declared by Homebrew.
- [gettext](https://www.automicvault.com/pkg/brew/gettext/) - Runtime dependency declared by Homebrew.
- [gmp](https://www.automicvault.com/pkg/brew/gmp/) - Runtime dependency declared by Homebrew.
- [icu4c@78](https://www.automicvault.com/pkg/brew/icu4c-78/) - Runtime dependency declared by Homebrew.
- [krb5](https://www.automicvault.com/pkg/brew/krb5/) - Runtime dependency declared by Homebrew.
- [curl](https://www.automicvault.com/pkg/brew/curl/) - Runtime dependency declared by Homebrew.
- [pkgconf](https://www.automicvault.com/pkg/brew/pkgconf/) - Build dependency declared by Homebrew.
- [httpd](https://www.automicvault.com/pkg/brew/httpd/) - Build dependency declared by Homebrew.
- [php](https://www.automicvault.com/pkg/brew/php/) - Package name indicates the same formula family.
- [php@8.3](https://www.automicvault.com/pkg/brew/php-8-3/) - Package name indicates the same formula family.
- [php@8.1](https://www.automicvault.com/pkg/brew/php-8-1/) - Package name indicates the same formula family.
- [php@8.4](https://www.automicvault.com/pkg/brew/php-8-4/) - Package name indicates the same formula family.
- [Secret-risk packages](https://www.automicvault.com/pkg/secret-risk-packages/)

## 来源

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- package version freshness
- package relationship graph
- cross-ecosystem install command graph
