diff --git a/php-worker/Dockerfile b/php-worker/Dockerfile index db1f693..7a96403 100644 --- a/php-worker/Dockerfile +++ b/php-worker/Dockerfile @@ -111,8 +111,13 @@ RUN if [ ${INSTALL_SOAP} = true ]; then \ # Install MongoDB drivers: ARG INSTALL_MONGO=false RUN if [ ${INSTALL_MONGO} = true ]; then \ - pecl install mongodb; \ - docker-php-ext-enable mongodb; \ + if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ + pecl install mongo; \ + docker-php-ext-enable mongo; \ + else \ + pecl install mongodb; \ + docker-php-ext-enable mongodb; \ + fi; \ fi #Install BCMath package: @@ -357,6 +362,16 @@ RUN if [ ${INSTALL_XMLRPC} = true ]; then \ docker-php-ext-install xmlrpc \ ;fi +RUN if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ + pecl install mongo; \ + docker-php-ext-enable mongo; \ + php -m | grep -q 'mongo'; \ + else \ + pecl install mongodb; \ + docker-php-ext-enable mongodb; \ + php -m | grep -q 'mongodb'; \ + fi + # #-------------------------------------------------------------------------- # Optional Supervisord Configuration