Install yaml extention in PHP

Oct 01, 2024 • edited Oct 06, 2024 • One minute to read

Step 1

$brew uninstall libyaml
Uninstalling /opt/homebrew/Cellar/libyaml/0.2.5... (10 files, 369.7KB)

Step 2

$brew install libyaml 
==> Downloading https://github.com/yaml/libyaml/archive/0.2.5.tar.gz
Already downloaded: /Users/**/Library/Caches/Homebrew/downloads/688fdcea5b88140cb83d1f72e3a77fa76b6560f0d66eabcea7d54cf9f06d5e72--libyaml-0.2.5.tar.gz
==> ./bootstrap
==> ./configure --prefix=/opt/homebrew/Cellar/libyaml/0.2.5
==> make install
🍺  /opt/homebrew/Cellar/libyaml/0.2.5: 10 files, 369.7KB, built in 12 seconds

Step3 copy the prefix in step2.

#In this case,It's
/opt/homebrew/Cellar/libyaml/0.2.5

Step 4

$sudo pecl install yaml
Password:
downloading yaml-2.2.1.tgz ...
Starting to download yaml-2.2.1.tgz (40,977 bytes)
............done: 40,977 bytes
8 source files, building
running: phpize
Configuring for:
PHP Api Version:         20160303
Zend Module Api No:      20160303
Zend Extension Api No:   320160303
Please provide the prefix of libyaml installation [autodetect] : 

if errors:

$sudo brew install autoconf
$sudo pecl install --ignore-errors yaml

Step 5

Please provide the prefix of libyaml installation [autodetect] : /opt/homebrew/Cellar/libyaml/0.2.5

Step 6

pecl install yaml
Phpphpyaml

Vps Config