Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install Php 7 with MongoDB driver on Docker from Ubuntu trusty base image.
FROM ubuntu:trusty
ENV HOME /root
ENV LC_ALL C.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
RUN add-apt-repository ppa:ondrej/php && \
apt-get update
RUN apt-get -y install php7.0-fpm php7.0-mysql php7.0-curl php7.0-mcrypt php7.0-cli php7.0-dev php-pear libsasl2-dev
RUN mkdir -p /usr/local/openssl/include/openssl/ && \
ln -s /usr/include/openssl/evp.h /usr/local/openssl/include/openssl/evp.h && \
mkdir -p /usr/local/openssl/lib/ && \
ln -s /usr/lib/x86_64-linux-gnu/libssl.a /usr/local/openssl/lib/libssl.a && \
ln -s /usr/lib/x86_64-linux-gnu/libssl.so /usr/local/openssl/lib/
RUN pecl install mongodb
RUN echo "extension=mongodb.so" > /etc/php/7.0/fpm/conf.d/20-mongodb.ini && \
echo "extension=mongodb.so" > /etc/php/7.0/cli/conf.d/20-mongodb.ini && \
echo "extension=mongodb.so" > /etc/php/7.0/mods-available/mongodb.ini
@golfreeze
Copy link

golfreeze commented Apr 8, 2017

Thank you!

@zoombieuit
Copy link

zoombieuit commented Mar 12, 2020

Thanks you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment