wodby / drupal-php

PHP docker container image for Drupal
https://wodby.com/stacks/drupal
MIT License
60 stars 80 forks source link

Question: How to downgrade mongodb extension version #91

Closed iLexN closed 2 years ago

iLexN commented 2 years ago

I am using this image wodby/drupal-php:7.4-4.37.0

I need to connect to mongodb, but will this error

reports wire version 5, but this version of libmongoc requires at least 6 (MongoDB 3.6) 

This look like. i need the mongodb version 1.9.1

I add the below line in the Dockerfile,

RUN pecl uninstall mongodb
RUN pecl install mongodb-1.9.1

But fail with error

... ...
 => [14/30] RUN pecl uninstall mongodb                                                                                                                                                     4.9s
 => ERROR [15/30] RUN pecl install mongodb-1.9.1                                                                                                                                          40.9s
------
 > [15/30] RUN pecl install mongodb-1.9.1:
#0 0.340 PHP Warning:  PHP Startup: Unable to load dynamic library 'mongodb' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20190902/mongodb (Error loading shared library /usr/local/lib/php/extensions/no-debug-non-zts-20190902/mongodb: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20190902/mongodb.so (Error loading shared library /usr/local/lib/php/extensions/no-debug-non-zts-20190902/mongodb.so: No such file or directory)) in Unknown on line 0
#0 5.966 downloading mongodb-1.9.1.tgz ...
#0 5.967 Starting to download mongodb-1.9.1.tgz (1,285,984 bytes)
#0 6.272 ..............................................................................................................................................................................................................................................................done: 1,285,984 bytes
#0 38.61 586 source files, building
#0 38.66 running: phpize
#0 38.67 Configuring for:
#0 38.67 PHP Api Version:         20190902
#0 38.67 Zend Module Api No:      20190902
#0 38.67 Zend Extension Api No:   320190902
#0 39.34 configure.ac:18: warning: $as_echo is obsolete; use AS_ECHO(["message"]) instead
#0 39.34 build/php.m4:2110: PHP_CONFIG_NICE is expanded from...
#0 39.34 configure.ac:18: the top level
#0 39.34 scripts/autotools/CheckCompiler.m4:63: warning: The macro `AC_TRY_COMPILE' is obsolete.
#0 39.34 scripts/autotools/CheckCompiler.m4:63: You should run autoupdate.
#0 39.34 ./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
#0 39.34 scripts/autotools/m4/ax_prototype.m4:208: AX_PROTOTYPE_LOOP is expanded from...
#0 39.34 scripts/autotools/m4/ax_prototype.m4:190: AX_PROTOTYPE_EACH is expanded from...
#0 39.34 scripts/autotools/m4/ax_prototype.m4:208: AX_PROTOTYPE_LOOP is expanded from...
#0 39.34 scripts/autotools/m4/ax_prototype.m4:190: AX_PROTOTYPE_EACH is expanded from...
#0 39.34 scripts/autotools/m4/ax_prototype.m4:208: AX_PROTOTYPE_LOOP is expanded from...
#0 39.34 scripts/autotools/m4/ax_prototype.m4:120: AX_PROTOTYPE is expanded from...
#0 39.34 scripts/autotools/CheckCompiler.m4:63: the top level
#0 39.34 scripts/autotools/CheckCompiler.m4:63: warning: The macro `AC_TRY_COMPILE' is obsolete.
#0 39.34 scripts/autotools/CheckCompiler.m4:63: You should run autoupdate.
#0 39.34 ./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
#0 39.34 scripts/autotools/m4/ax_prototype.m4:208: AX_PROTOTYPE_LOOP is expanded from...
#0 39.34 scripts/autotools/m4/ax_prototype.m4:190: AX_PROTOTYPE_EACH is expanded from...
#0 39.34 scripts/autotools/m4/ax_prototype.m4:190: AX_PROTOTYPE_EACH is expanded from...
#0 39.34 scripts/autotools/m4/ax_prototype.m4:208: AX_PROTOTYPE_LOOP is expanded from...
#0 39.34 scripts/autotools/m4/ax_prototype.m4:190: AX_PROTOTYPE_EACH is expanded from...
#0 39.34 scripts/autotools/m4/ax_prototype.m4:208: AX_PROTOTYPE_LOOP is expanded from...
#0 39.34 scripts/autotools/m4/ax_prototype.m4:120: AX_PROTOTYPE is expanded from...
#0 39.34 scripts/autotools/CheckCompiler.m4:63: the top level
#0 39.34 scripts/autotools/CheckCompiler.m4:63: warning: The macro `AC_TRY_COMPILE' is obsolete.
#0 39.34 scripts/autotools/CheckCompiler.m4:63: You should run autoupdate.
#0 39.34 ./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
#0 39.34 scripts/autotools/m4/ax_prototype.m4:208: AX_PROTOTYPE_LOOP is expanded from...
#0 39.34 scripts/autotools/m4/ax_prototype.m4:190: AX_PROTOTYPE_EACH is expanded from...
#0 39.34 scripts/autotools/m4/ax_prototype.m4:208: AX_PROTOTYPE_LOOP is expanded from...
#0 39.34 scripts/autotools/m4/ax_prototype.m4:190: AX_PROTOTYPE_EACH is expanded from...
#0 39.34 scripts/autotools/m4/ax_prototype.m4:190: AX_PROTOTYPE_EACH is expanded from...
#0 39.34 scripts/autotools/m4/ax_prototype.m4:208: AX_PROTOTYPE_LOOP is expanded from...
#0 39.34 scripts/autotools/m4/ax_prototype.m4:120: AX_PROTOTYPE is expanded from...
#0 39.34 scripts/autotools/CheckCompiler.m4:63: the top level
#0 39.34 scripts/autotools/CheckCompiler.m4:63: warning: The macro `AC_TRY_COMPILE' is obsolete.
#0 39.34 scripts/autotools/CheckCompiler.m4:63: You should run autoupdate.
#0 39.34 ./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
#0 39.34 scripts/autotools/m4/ax_prototype.m4:208: AX_PROTOTYPE_LOOP is expanded from...
#0 39.34 scripts/autotools/m4/ax_prototype.m4:190: AX_PROTOTYPE_EACH is expanded from...
#0 39.34 scripts/autotools/m4/ax_prototype.m4:190: AX_PROTOTYPE_EACH is expanded from...
#0 39.34 scripts/autotools/m4/ax_prototype.m4:208: AX_PROTOTYPE_LOOP is expanded from...
#0 39.35 scripts/autotools/m4/ax_prototype.m4:190: AX_PROTOTYPE_EACH is expanded from...
#0 39.35 scripts/autotools/m4/ax_prototype.m4:190: AX_PROTOTYPE_EACH is expanded from...
#0 39.35 scripts/autotools/m4/ax_prototype.m4:208: AX_PROTOTYPE_LOOP is expanded from...
#0 39.35 scripts/autotools/m4/ax_prototype.m4:120: AX_PROTOTYPE is expanded from...
#0 39.35 scripts/autotools/CheckCompiler.m4:63: the top level
#0 39.35 scripts/autotools/CheckCompiler.m4:63: warning: The macro `AC_TRY_COMPILE' is obsolete.
#0 39.35 scripts/autotools/CheckCompiler.m4:63: You should run autoupdate.
#0 39.35 ./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
#0 39.35 scripts/autotools/m4/ax_prototype.m4:208: AX_PROTOTYPE_LOOP is expanded from...
#0 39.35 scripts/autotools/m4/ax_prototype.m4:190: AX_PROTOTYPE_EACH is expanded from...
#0 39.35 scripts/autotools/m4/ax_prototype.m4:208: AX_PROTOTYPE_LOOP is expanded from...
#0 39.35 scripts/autotools/m4/ax_prototype.m4:190: AX_PROTOTYPE_EACH is expanded from...
#0 39.35 scripts/autotools/m4/ax_prototype.m4:190: AX_PROTOTYPE_EACH is expanded from...
#0 39.35 scripts/autotools/m4/ax_prototype.m4:190: AX_PROTOTYPE_EACH is expanded from...
#0 39.35 scripts/autotools/m4/ax_prototype.m4:208: AX_PROTOTYPE_LOOP is expanded from...
#0 39.35 scripts/autotools/m4/ax_prototype.m4:120: AX_PROTOTYPE is expanded from...
#0 39.35 scripts/autotools/CheckCompiler.m4:63: the top level
#0 39.35 scripts/autotools/CheckCompiler.m4:63: warning: The macro `AC_TRY_COMPILE' is obsolete.
#0 39.35 scripts/autotools/CheckCompiler.m4:63: You should run autoupdate.
#0 39.35 ./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
#0 39.35 scripts/autotools/m4/ax_prototype.m4:208: AX_PROTOTYPE_LOOP is expanded from...
#0 39.35 scripts/autotools/m4/ax_prototype.m4:190: AX_PROTOTYPE_EACH is expanded from...
#0 39.35 scripts/autotools/m4/ax_prototype.m4:190: AX_PROTOTYPE_EACH is expanded from...
#0 39.35 scripts/autotools/m4/ax_prototype.m4:208: AX_PROTOTYPE_LOOP is expanded from...
#0 39.35 scripts/autotools/m4/ax_prototype.m4:190: AX_PROTOTYPE_EACH is expanded from...
#0 39.35 scripts/autotools/m4/ax_prototype.m4:190: AX_PROTOTYPE_EACH is expanded from...
#0 39.35 scripts/autotools/m4/ax_prototype.m4:190: AX_PROTOTYPE_EACH is expanded from...
#0 39.35 scripts/autotools/m4/ax_prototype.m4:208: AX_PROTOTYPE_LOOP is expanded from...
#0 39.35 scripts/autotools/m4/ax_prototype.m4:120: AX_PROTOTYPE is expanded from...
#0 39.35 scripts/autotools/CheckCompiler.m4:63: the top level
#0 39.35 configure.ac:161: warning: The macro `AC_LANG_C' is obsolete.
#0 39.35 configure.ac:161: You should run autoupdate.
#0 39.36 ./lib/autoconf/c.m4:72: AC_LANG_C is expanded from...
#0 39.36 build/libtool.m4:2727: _LT_AC_LANG_C_CONFIG is expanded from...
#0 39.36 build/libtool.m4:2726: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
#0 39.36 build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from...
#0 39.36 build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from...
#0 39.36 build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from...
#0 39.36 configure.ac:161: the top level
#0 39.36 configure.ac:161: warning: The macro `AC_LANG_C' is obsolete.
#0 39.36 configure.ac:161: You should run autoupdate.
#0 39.36 ./lib/autoconf/c.m4:72: AC_LANG_C is expanded from...
#0 39.36 lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
#0 39.36 lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
#0 39.36 ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
#0 39.36 ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
#0 39.36 build/libtool.m4:561: _LT_AC_LOCK is expanded from...
#0 39.36 build/libtool.m4:1184: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from...
#0 39.36 build/libtool.m4:2727: _LT_AC_LANG_C_CONFIG is expanded from...
#0 39.36 build/libtool.m4:2726: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
#0 39.36 build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from...
#0 39.36 build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from...
#0 39.36 build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from...
#0 39.36 configure.ac:161: the top level
#0 39.36 configure.ac:161: warning: The macro `AC_TRY_LINK' is obsolete.
#0 39.36 configure.ac:161: You should run autoupdate.
#0 39.36 ./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
#0 39.36 lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
#0 39.36 lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
#0 39.36 ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
#0 39.36 ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
#0 39.36 build/libtool.m4:561: _LT_AC_LOCK is expanded from...
#0 39.36 build/libtool.m4:1184: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from...
#0 39.36 build/libtool.m4:2727: _LT_AC_LANG_C_CONFIG is expanded from...
#0 39.36 build/libtool.m4:2726: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
#0 39.36 build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from...
#0 39.36 build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from...
#0 39.36 build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from...
#0 39.36 configure.ac:161: the top level
#0 39.36 configure.ac:161: warning: back quotes and double quotes must not be escaped in: $as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe
#0 39.36 build/libtool.m4:1184: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from...
#0 39.36 build/libtool.m4:2727: _LT_AC_LANG_C_CONFIG is expanded from...
#0 39.36 build/libtool.m4:2726: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
#0 39.36 build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from...
#0 39.36 build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from...
#0 39.36 build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from...
#0 39.36 configure.ac:161: the top level
#0 39.36 configure.ac:161: warning: back quotes and double quotes must not be escaped in: $as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe
#0 39.36 build/libtool.m4:1184: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from...
#0 39.36 build/libtool.m4:2727: _LT_AC_LANG_C_CONFIG is expanded from...
#0 39.36 build/libtool.m4:2726: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
#0 39.36 build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from...
#0 39.37 build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from...
#0 39.37 build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from...
#0 39.37 configure.ac:161: the top level
#0 39.37 configure.ac:161: warning: back quotes and double quotes must not be escaped in: $as_me:${as_lineno-$LINENO}: WARNING: output file \`$ofile' does not exist
#0 39.37 build/libtool.m4:1917: _LT_AC_TAGCONFIG is expanded from...
#0 39.37 build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from...
#0 39.37 build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from...
#0 39.37 build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from...
#0 39.37 configure.ac:161: the top level
#0 39.37 configure.ac:161: warning: back quotes and double quotes must not be escaped in: $as_me: WARNING: output file \`$ofile' does not exist
#0 39.37 build/libtool.m4:1917: _LT_AC_TAGCONFIG is expanded from...
#0 39.37 build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from...
#0 39.37 build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from...
#0 39.37 build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from...
#0 39.37 configure.ac:161: the top level
#0 39.37 configure.ac:161: warning: back quotes and double quotes must not be escaped in: $as_me:${as_lineno-$LINENO}: WARNING: output file \`$ofile' does not look like a libtool script
#0 39.37 build/libtool.m4:1917: _LT_AC_TAGCONFIG is expanded from...
#0 39.37 build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from...
#0 39.37 build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from...
#0 39.37 build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from...
#0 39.37 configure.ac:161: the top level
#0 39.37 configure.ac:161: warning: back quotes and double quotes must not be escaped in: $as_me: WARNING: output file \`$ofile' does not look like a libtool script
#0 39.37 build/libtool.m4:1917: _LT_AC_TAGCONFIG is expanded from...
#0 39.37 build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from...
#0 39.37 build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from...
#0 39.37 build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from...
#0 39.37 configure.ac:161: the top level
#0 39.37 configure.ac:161: warning: back quotes and double quotes must not be escaped in: $as_me:${as_lineno-$LINENO}: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'
#0 39.37 build/libtool.m4:1917: _LT_AC_TAGCONFIG is expanded from...
#0 39.37 build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from...
#0 39.37 build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from...
#0 39.37 build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from...
#0 39.37 configure.ac:161: the top level
#0 39.37 configure.ac:161: warning: back quotes and double quotes must not be escaped in: $as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'
#0 39.37 build/libtool.m4:1917: _LT_AC_TAGCONFIG is expanded from...
#0 39.37 build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from...
#0 39.37 build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from...
#0 39.37 build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from...
#0 39.37 configure.ac:161: the top level
#0 39.38 configure.ac:161: warning: back quotes and double quotes must not be escaped in: tag name \"$tagname\" already exists
#0 39.38 build/libtool.m4:1917: _LT_AC_TAGCONFIG is expanded from...
#0 39.38 build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from...
#0 39.38 build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from...
#0 39.38 build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from...
#0 39.38 configure.ac:161: the top level
#0 39.38 configure.ac:161: warning: The macro `AC_LANG_CPLUSPLUS' is obsolete.
#0 39.38 configure.ac:161: You should run autoupdate.
#0 39.38 ./lib/autoconf/c.m4:262: AC_LANG_CPLUSPLUS is expanded from...
#0 39.38 build/libtool.m4:2809: _LT_AC_LANG_CXX_CONFIG is expanded from...
#0 39.38 build/libtool.m4:2808: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
#0 39.38 build/libtool.m4:1917: _LT_AC_TAGCONFIG is expanded from...
#0 39.38 build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from...
#0 39.38 build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from...
#0 39.38 build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from...
#0 39.38 configure.ac:161: the top level
#0 39.38 configure.ac:161: warning: back quotes and double quotes must not be escaped in: $as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe
#0 39.38 build/libtool.m4:1184: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from...
#0 39.38 build/libtool.m4:2809: _LT_AC_LANG_CXX_CONFIG is expanded from...
#0 39.38 build/libtool.m4:2808: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
#0 39.38 build/libtool.m4:1917: _LT_AC_TAGCONFIG is expanded from...
#0 39.38 build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from...
#0 39.38 build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from...
#0 39.38 build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from...
#0 39.38 configure.ac:161: the top level
#0 39.38 configure.ac:161: warning: back quotes and double quotes must not be escaped in: $as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe
#0 39.38 build/libtool.m4:1184: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from...
#0 39.38 build/libtool.m4:2809: _LT_AC_LANG_CXX_CONFIG is expanded from...
#0 39.38 build/libtool.m4:2808: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
#0 39.38 build/libtool.m4:1917: _LT_AC_TAGCONFIG is expanded from...
#0 39.38 build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from...
#0 39.38 build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from...
#0 39.38 build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from...
#0 39.38 configure.ac:161: the top level
#0 40.39 building in /tmp/pear/temp/pear-build-defaultuserdDhfHj/mongodb-1.9.1
#0 40.40 running: /tmp/pear/temp/mongodb/configure --with-php-config=/usr/local/bin/php-config
#0 40.51 checking for grep that handles long lines and -e... /bin/grep
#0 40.51 checking for egrep... /bin/grep -E
#0 40.51 checking for a sed that does not truncate output... /bin/sed
#0 40.52 checking for pkg-config... /usr/bin/pkg-config
#0 40.52 checking pkg-config is at least version 0.9.0... yes
#0 40.52 checking for cc... no
#0 40.52 checking for gcc... no
#0 40.52 configure: error: in `/tmp/pear/temp/pear-build-defaultuserdDhfHj/mongodb-1.9.1':
#0 40.52 configure: error: no acceptable C compiler found in $PATH
#0 40.52 See `config.log' for more details
#0 40.66 ERROR: `/tmp/pear/temp/mongodb/configure --with-php-config=/usr/local/bin/php-config' failed
------
failed to solve: executor failed running [/bin/sh -c pecl install mongodb-1.9.1]: exit code: 1

Any recommend way to install mongodb 1.9.1?

Thanks

csandanov commented 2 years ago

The error says:

#0 40.52 configure: error: no acceptable C compiler found in $PATH

you didn't install compilation tools, also you probably need to extract php source, the archive is available in the dev version of images

iLexN commented 2 years ago

Finially this work for me.

RUN rm -f /usr/local/lib/php/extensions/no-debug-non-zts-20190902/mongodb.so
RUN apk --update add --virtual build-dependencies build-base openssl-dev autoconf \
  && pecl install -f "mongodb-1.9.1"\
  && docker-php-ext-enable mongodb \
  && apk del build-dependencies build-base openssl-dev autoconf \
  && rm -rf /var/cache/apk/*

Thanks.