mac安装php扩展yaml

首先安装 libyaml

$ brew install libyaml

==> Downloading https://ghcr.io/v2/homebrew/core/libyaml/manifests/0.2.5
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libyaml/blobs/sha256:a436da33a05f805258c5951a365dec4e8d70a908dbe5dacdeb6b2ecd0efd5024
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:a436da33a05f805258c5951a365dec4e8d70a908dbe5dacdeb6b2ecd0efd5024?se=2021-11-05T09%3A00%3
######################################################################## 100.0%
==> Pouring libyaml--0.2.5.arm64_monterey.bottle.tar.gz
  /opt/homebrew/Cellar/libyaml/0.2.5: 10 files, 353KB

记录一下这一步里的libyaml路径:

/opt/homebrew/Cellar/libyaml/0.2.5

然后安装 yaml

$ pecl install yaml
.......
Please provide the prefix of libyaml installation [autodetect] : 

粘贴上一步得到的libyaml路径

安装完成,检查一下

$ php -m | grep yaml
yaml

你可能感兴趣的:(phpyaml)