Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP extensions loaded twice #644

Open
denniswoot opened this issue Sep 14, 2021 · 2 comments
Open

PHP extensions loaded twice #644

denniswoot opened this issue Sep 14, 2021 · 2 comments

Comments

@denniswoot
Copy link

denniswoot commented Sep 14, 2021

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.
@denniswoot
Copy link
Author

I have fixed this issue for now with the following code:

profiles::apache_dino_cms::php::extensions:
    xml:
      ensure: installed
      ini_prefix: '20-'
    pdo:
      ensure: installed
      ini_prefix: '20-' 
    gd:
      ensure: installed
      ini_prefix: '20-' 
    opcache:
      ensure: installed
      zend: true
      ini_prefix: '20-' 
    mysqlnd:
      ensure: installed
      ini_prefix: '20-' 
    pecl-apcu:
      ensure: installed
      ini_prefix: '20-' 
    mbstring:
      ensure: installed
      ini_prefix: '20-' 
    intl:
      ensure: installed
      ini_prefix: '20-'  
    ldap: 
      ensure: installed

@diegoluisi
Copy link

I have the same problem here..

php::extensions: amqp: settings: {} bcmath: settings: {} dba: settings: {} gd: settings: {} imagick: settings: {} intl: settings: {} ldap: settings: {} mbstring: ini_prefix: '20-' mcrypt: settings: {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants