Skip to content
This repository has been archived by the owner on Feb 13, 2023. It is now read-only.

Install YAML Extensions? #1068

Closed
kevinquillen opened this issue Dec 21, 2016 · 4 comments
Closed

Install YAML Extensions? #1068

kevinquillen opened this issue Dec 21, 2016 · 4 comments
Labels

Comments

@kevinquillen
Copy link

Issue Type

  • Feature Idea

Your Environment

Vagrant 1.8.6
VirtualBox
5.0.26r108824
ansible 2.1.0.0
  config file =
  configured module search path = Default w/o overrides

Your OS

  • macOS (10.12.1)

Summary

Not sure if this is the best place for this, or maybe a pointer on how to install this so I can match my Acquia environment, but I have a discrepancy that cost a couple of hours yesterday.

I reported the issue here: One of the declarations in that routing file was double quoted, when it should be single quoted. I reported the issue here: https://www.drupal.org/node/2838151

It also seems that since I do not have the YAML extensions installed with the PHP config of my local VM (DrupalVM), this error did not occur. The Acquia environment does have the YAML extension installed. This is an important detail because I am told that Symfony parses YAML slightly differently in both cases - Symfony is more lax, where the YAML extension is more strict. This is why I could not reproduce locally.

How can I add that to the DrupalVM so it more closely matches my production environment?

@oxyc
Copy link
Collaborator

oxyc commented Dec 21, 2016

References:

Seems ondrej provides this for all PHP versions.

vagrant@drupalvm-project:~$ apt-cache show php-yaml
Package: php-yaml
Priority: optional
Section: php
Installed-Size: 278
Maintainer: Debian PHP PECL Maintainers <pkg-php-pecl@lists.alioth.debian.org>
Architecture: amd64
Version: 2.0.0+1.3.0-2+deb.sury.org~precise+1
Provides: php5.5-yaml, php5.6-yaml, php7.0-yaml, php7.1-yaml
Depends: php-common (>= 1:7.0+33~), phpapi-20160303 | phpapi-20151012 | phpapi-20131226 | phpapi-20121212, libc6 (>= 2.14), libyaml-0-2
Filename: pool/main/p/php-yaml/php-yaml_2.0.0+1.3.0-2+deb.sury.org~precise+1_amd64.deb
Size: 82202
MD5sum: 9884a653725f3292299bcba79c96bc25
SHA1: aecb27eb803c9eaeb4ec3cc21afbbf6674415acf
SHA256: f5ed833828c5cd20085a9f4fdcd35fa079f18700ff8d05678d3d61da6c3cd8a3
Description-en: YAML-1.1 parser and emitter for PHP
 PHP extension adding support for YAML 1.1 (YAML Ain't Markup
 Language) serialization using the LibYAML library.
Description-md5: 1bfaf65b64a715c72224ee22bc952860

You can install it by adding php{{ php_version }}-yaml to extra_packages (if you're using Ubuntu that is, not sure about Centos). This wouldn't work with the new version switching feature though.

To get version switching working you can override the php_packages which is previously defined in provisioning/vars/Debian.yml and add the yaml package at the end:

php_packages:
  - "php{{ php_version }}"
  - "php{{ php_version }}-apcu"
  - "php{{ php_version }}-cli"
  - "php{{ php_version }}-common"
  - "php{{ php_version }}-curl"
  - "php{{ php_version }}-dev"
  - "php{{ php_version }}-fpm"
  - "php{{ php_version }}-gd"
  - "php{{ php_version }}-imap"
  - "php{{ php_version }}-json"
  - "php{{ php_version }}-mbstring"
  - "php{{ php_version }}-mcrypt"
  - "php{{ php_version }}-opcache"
  - "php{{ php_version }}-sqlite3"
  - "php{{ php_version }}-xml"
  - "php{{ php_version }}-yaml"

Edit: @geerlingguy maybe this should be added as a default? I assume it's also easily available on centos.


Edit 2017-01-06: If someone is looking for how to add custom php packages, now you can:

php_packages_extra:
  - "php{{ php_version }}-yaml"

Without having to override the vast array of all the packages.

@geerlingguy
Copy link
Owner

@oxyc - If it is available in CentOS, then yes, that's fine by me. Apparently there was quite a fraças over Symfony's YAML parser vs. the PHP one recently, and having this installed by default might help people testing YAML they're deploying to servers where the PHP extension is installed...

@geerlingguy
Copy link
Owner

And YAML is the new XML (but way more awesome-r), and we already include the xml... and json extensions.

oxyc added a commit to oxyc/drupal-vm that referenced this issue Dec 22, 2016
geerlingguy added a commit that referenced this issue Dec 23, 2016
Issue #1068: Add php-yaml as a default php package
@oxyc
Copy link
Collaborator

oxyc commented Dec 23, 2016

This is now installed by default.

@oxyc oxyc closed this as completed Dec 23, 2016
kekkis pushed a commit to kekkis/drupal-vm that referenced this issue Feb 23, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants