voxpupuli / voxpupuli/puppet-php

PHP extensions loaded twice

Open
#644 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Puppet
Stars
86
Forks
264
Avg merge
29m
Merged PRs (30d)
1

Description

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: agent 6.24.0
  • Ruby:
  • Distribution: RHEL 8.4
  • Module version: latest

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

  class { '::php::globals':
     php_version => '7.4',
   } ->
   class { '::php':
     composer     => true,
     settings     => {
       'PHP/memory_limit'        => '64M',
       'PHP/post_max_size'       => '32M',
       'PHP/upload_max_filesize' => '32M',
       'Date/date.timezone'      =>  'Europe/Amsterdam',
     },
     extensions   => {
       xlm   => { },
       pdo  => { },
       gd      => { },
       opcache => { },
       mysqlnd => {},
       pecl-apcu => {},
     } 
   }

What are you seeing

[root@dinodevapp29 etc]# php -v
PHP Warning:  Module 'gd' already loaded in Unknown on line 0
PHP Warning:  Module 'intl' already loaded in Unknown on line 0
PHP Warning:  Module 'ldap' already loaded in Unknown on line 0
PHP Warning:  Module 'mbstring' already loaded in Unknown on line 0
PHP Warning:  Module 'mysqlnd' already loaded in Unknown on line 0
PHP Warning:  PHP Startup: Invalid library (appears to be a Zend Extension, try loading using zend_extension=opcache.so from php.ini) in Unknown on line 0
PHP Warning:  Module 'PDO' already loaded in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'pecl-apcu.so' (tried: /usr/lib64/php/modules/pecl-apcu.so (/usr/lib64/php/modules/pecl-apcu.so: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/pecl-apcu.so.so (/usr/lib64/php/modules/pecl-apcu.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  Module 'xml' already loaded in Unknown on line 0
PHP 7.4.6 (cli) (built: May 12 2020 08:09:15) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.6, Copyright (c), by Zend Technologies
[root@dinodevapp29 etc]#

[root@dinodevapp29 etc]# cd /etc/php.d/
10-opcache.ini             20-fileinfo.ini            20-ldap.ini                20-simplexml.ini           20-xml.ini                 40-apcu.ini                opcache.ini
20-bz2.ini                 20-ftp.ini                 20-mbstring.ini            20-sockets.ini             20-xmlwriter.ini           gd.ini                     pdo.ini
20-calendar.ini            20-gd.ini                  20-mysqlnd.ini             20-sqlite3.ini             20-xsl.ini                 intl.ini                   pecl-apcu.ini
20-ctype.ini               20-gettext.ini             20-pdo.ini                 20-sysvmsg.ini             30-mysqli.ini              ldap.ini                   xml.ini
20-curl.ini                20-iconv.ini               20-phar.ini                20-sysvsem.ini             30-pdo_mysql.ini           mbstring.ini
20-dom.ini                 20-intl.ini                20-posix.ini               20-sysvshm.ini             30-pdo_sqlite.ini          mysqlnd.ini
20-exif.ini                20-json.ini                20-shmop.ini               20-tokenizer.ini           30-xmlreader.ini           opcache-default.blacklist
[root@dinodevapp29 etc]# cd /etc/php.d/

What behaviour did you expect instead

no php warnings

Output log

PHP Warning:  Module 'gd' already loaded in Unknown on line 0
PHP Warning:  Module 'intl' already loaded in Unknown on line 0
PHP Warning:  Module 'ldap' already loaded in Unknown on line 0
PHP Warning:  Module 'mbstring' already loaded in Unknown on line 0
PHP Warning:  Module 'mysqlnd' already loaded in Unknown on line 0
PHP Warning:  PHP Startup: Invalid library (appears to be a Zend Extension, try loading using zend_extension=opcache.so from php.ini) in Unknown on line 0
PHP Warning:  Module 'PDO' already loaded in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'pecl-apcu.so' (tried: /usr/lib64/php/modules/pecl-apcu.so (/usr/lib64/php/modules/pecl-apcu.so: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/pecl-apcu.so.so (/usr/lib64/php/modules/pecl-apcu.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported Puppet class parameters and inspect the generated files in /etc/php.d/, comparing entries such as gd.ini, opcache.ini, pdo.ini, and pecl-apcu.ini with the PHP extensions requested. Reproduce with php -v and verify that the configuration no longer loads extensions twice, reports an invalid opcache library, or cannot find pecl-apcu.so.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.