voxpupuli / puppet-php

Generic Puppet module to manage PHP on many platforms
http://forge.puppet.com/puppet/php
MIT License
87 stars 268 forks source link

php 7.2 + ubuntu 16.04 - pdo-mysql extension not installing correctly #405

Closed jackdpeterson closed 6 years ago

jackdpeterson commented 6 years ago

Affected Puppet, Ruby, OS and module versions/distributions

How to reproduce (e.g Puppet code you use)

Puppet:

include ::php

Hiera:

version: 5
site_reliability_engineering::user: 'ubuntu'
site_reliability_engineering::group: 'ubuntu'
php::manage_repos: true
php::globals::php_version: '7.2'
php::ensure: latest
php::fpm: true
php::phpunit: false
php::package_prefix: 'php7.2-'
php::settings:
  PHP/post_max_size: '25M'
  PHP/memory_limit: '256M'
  PHP/upload_max_filesize: '20M'
  Date/date.timezone: 'America/Los_Angeles'
  iconv/iconv.input_encoding: 'UTF-8'
  iconv/iconv.internal_encoding: 'UTF-8'
  iconv/iconv.output_encoding: 'UTF-8'
php::cli::settings:
  PHP/memory_limit: '512M'
php::extensions:
  curl:
    package_prefix: 'php7.2-'
  gd:
    package_prefix: 'php7.2-'
  intl:
    package_prefix: 'php7.2-'
  json:
    package_prefix: 'php7.2-'
  mbstring:
    package_prefix: 'php7.2-'
  mysql:
    package_prefix: 'php7.2-'
  readline:
    package_prefix: 'php7.2-'
  redis:
    package_prefix: 'php-'
  pdo:
    package_prefix: 'php7.2-'
  pdo-mysql:
    package_prefix: 'php7.2-'
  soap:
    package_prefix: 'php7.2-'
  zip:
    package_prefix: 'php7.2-'

What are you seeing

everything but php7.2-pdo-mysql are installed and configured correctly.

ubuntu@ip-172-31-20-126:/etc/php/7.2/mods-available$ ls -l
total 144
-rw-r--r-- 1 root root  74 Jan 11 22:41 calendar.ini
-rw-r--r-- 1 root root  71 Jan 11 22:41 ctype.ini
-rw-r--r-- 1 root root  68 Jan 11 22:41 curl.ini
-rw-r--r-- 1 root root  66 Jan 11 22:41 dom.ini
-rw-r--r-- 1 root root  70 Jan 11 22:41 exif.ini
-rw-r--r-- 1 root root  74 Jan 11 22:41 fileinfo.ini
-rw-r--r-- 1 root root  69 Jan 11 22:41 ftp.ini
-rw-r--r-- 1 root root  64 Jan 11 22:41 gd.ini
-rw-r--r-- 1 root root  73 Jan 11 22:41 gettext.ini
-rw-r--r-- 1 root root  71 Jan 11 22:41 iconv.ini
-rw-r--r-- 1 root root 364 Sep  7 18:41 igbinary.ini
-rw-r--r-- 1 root root  68 Jan 11 22:41 intl.ini
-rw-r--r-- 1 root root  68 Jan 11 22:41 json.ini
-rw-r--r-- 1 root root  76 Jan 11 22:41 mbstring.ini
-rw-r--r-- 1 root root  71 Jan 11 22:41 mysqli.ini
-rw-r--r-- 1 root root  72 Jan 11 22:41 mysqlnd.ini
-rw-r--r-- 1 root root  79 Jan 11 22:41 opcache.ini
-rw-r--r-- 1 root root  69 Jan 11 22:41 pdo.ini
-rw-r--r-- 1 root root  70 Jan 11 22:41 phar.ini
-rw-r--r-- 1 root root  71 Jan 11 22:41 posix.ini
-rw-r--r-- 1 root root  76 Jan 11 22:41 readline.ini
-rw-r--r-- 1 root root  19 Jan 11 18:55 redis.ini
-rw-r--r-- 1 root root  71 Jan 11 22:41 shmop.ini
-rw-r--r-- 1 root root  72 Jan 11 22:41 simplexml.ini
-rw-r--r-- 1 root root  68 Jan 11 22:41 soap.ini
-rw-r--r-- 1 root root  73 Jan 11 22:41 sockets.ini
-rw-r--r-- 1 root root  73 Jan 11 22:41 sysvmsg.ini
-rw-r--r-- 1 root root  73 Jan 11 22:41 sysvsem.ini
-rw-r--r-- 1 root root  73 Jan 11 22:41 sysvshm.ini
-rw-r--r-- 1 root root  75 Jan 11 22:41 tokenizer.ini
-rw-r--r-- 1 root root  67 Jan 11 22:41 wddx.ini
-rw-r--r-- 1 root root  66 Jan 11 22:41 xml.ini
-rw-r--r-- 1 root root  72 Jan 11 22:41 xmlreader.ini
-rw-r--r-- 1 root root  72 Jan 11 22:41 xmlwriter.ini
-rw-r--r-- 1 root root  66 Jan 11 22:41 xsl.ini
-rw-r--r-- 1 root root  66 Jan 11 22:41 zip.ini

What behavior did you expect instead

Configuration file existing and pointing to the correct pdo_mysql.so (/usr/lib/php/20170718/pdo_mysql.so)

Output log

Repeated execution continues to display:

Notice: /Stage[main]/Php/Php::Extension[mysql]/Exec[/usr/sbin/phpenmod -v 7.2 -s ALL mysql]/returns: executed successfully
Notice: /Stage[main]/Php/Php::Extension[pdo]/Package[php7.2-pdo]/ensure: created
Notice: /Stage[main]/Php/Php::Extension[pdo-mysql]/Package[php7.2-pdo-mysql]/ensure: created
Notice: /Stage[main]/Php/Php::Extension[pdo-mysql]/Exec[/usr/sbin/phpenmod -v 7.2 -s ALL pdo-mysql]/returns: executed successfully
Notice: /Stage[main]/Php::Fpm::Service/Service[php7.2-fpm]: Triggered 'refresh' from 3 events
Notice: Applied catalog in 3.27 seconds

Any additional information you'd like to impart

manually executing the phpenmod displays a warning.

WARNING: Module pdo-mysql ini file doesn't exist under /etc/php/7.2/mods-available
WARNING: Module pdo-mysql ini file doesn't exist under /etc/php/7.2/mods-available
jackdpeterson commented 6 years ago

This was a local environment issue.

c33s commented 6 years ago

@jackdpeterson what was your exact problem? i have the same problem here only for debian & php7.1

jackdpeterson commented 6 years ago

My issue was actually pretty weird — the librarian puppet dependency installation was installing the wrong cached library. If I recall i was referencing the other similarly named library that’s as an older version.