File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -160,6 +160,10 @@ ARG INSTALL_MONGO=false
160160
161161RUN if [ ${INSTALL_MONGO} = true ]; then \
162162 # Install the mongodb extension
163+ if [ $(php -r "echo PHP_MAJOR_VERSION;" ) = "5" ]; then \
164+ pecl install mongo && \
165+ docker-php-ext-enable mongo \
166+ ;fi && \
163167 pecl install mongodb && \
164168 docker-php-ext-enable mongodb \
165169;fi
Original file line number Diff line number Diff line change @@ -292,7 +292,12 @@ ARG PHP_VERSION=${PHP_VERSION}
292292
293293RUN if [ ${INSTALL_MONGO} = true ]; then \
294294 # Install the mongodb extension
295- pecl -q install mongodb && \
295+ if [ $(php -r "echo PHP_MAJOR_VERSION;" ) = "5" ]; then \
296+ pecl install mongo && \
297+ echo "extension=mongo.so" >> /etc/php/${PHP_VERSION}/mods-available/mongo.ini && \
298+ ln -s /etc/php/${PHP_VERSION}/mods-available/mongo.ini /etc/php/${PHP_VERSION}/cli/conf.d/30-mongo.ini \
299+ ;fi && \
300+ pecl install mongodb && \
296301 echo "extension=mongodb.so" >> /etc/php/${PHP_VERSION}/mods-available/mongodb.ini && \
297302 ln -s /etc/php/${PHP_VERSION}/mods-available/mongodb.ini /etc/php/${PHP_VERSION}/cli/conf.d/30-mongodb.ini \
298303;fi
You can’t perform that action at this time.
0 commit comments