Skip to content
Advertisement

Exception: Function yaml_parse() does not exist

Please has anyone encountered the same problem? I wanted to use the yaml_parse() function of PHP. Basically I wanted to create a big object/class(Parser) that will allow me to parse not only yaml but also json, … etc. So I knew that some of you suggest Symfony/Yaml, etc…, in short I find these libraries too heavy for me, especially the symfony one, I even took a look at their compose.json which also requires a lot of other libraries. thanks in advance.function yaml_parse does not exist

Advertisement

Answer

sudo apt-get install php-dev php-pear libyaml-dev
sudo pecl install yamL
sudo sh -c "echo 'extension=yaml.so' >> /etc/php/7.4/cli/php.ini"

In /etc/php/7.4/cli/php.ini use your php version in the path

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement