Install PHP 8.0 Yaml extension on Ubuntu 18.04
0
votes
2
answers
1992
views
I wrote a simple php based on the fisrt example.
https://www.php.net/manual/es/function.yaml-parse.php
I got...
Fatal error: Uncaught Error: Call to undefined function yaml_parse() in /var/www/html/p.php:33 Stack trace: #0 {main} thrown in /var/www/html/p.php on line 33
I use ondrej repository to install php.
root@hidra:~# cat /etc/apt/sources.list.d/ondrej-ubuntu-php-bionic.list
deb http://ppa.launchpad.net/ondrej/php/ubuntu bionic main
deb-src http://ppa.launchpad.net/ondrej/php/ubuntu bionic main
There is no package to install yaml extension.
apt-file search phpize
apt-file search php8.0-yaml
apt-file search php8.2-yaml
Ok, let's try to compile it with phpize.
There is not phpize either or php8.0-dev (In debian phpize ussualy is there)
root@hidra:~# apt-get install php8.0-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php8.0-dev
E: Couldn't find any package by glob 'php8.0-dev'
E: Couldn't find any package by regex 'php8.0-dev'
I tried with Ubuntu 22.04 too. The ondrej have no php8.x-dev php8.x-yaml. And php-dev o php-yaml try to install php7.2 versions.
Besides, ymal code on PECL requires php 7.
What would be the proper way to install it in these circumstances?
I have used https://github.com/dallgoot/yaml to solve it, but I have curiosity with this issue.
Asked by icalvete
(101 rep)
Nov 15, 2023, 08:45 PM
Last activity: Jun 25, 2025, 08:07 PM
Last activity: Jun 25, 2025, 08:07 PM