No preferable way to install custom extension that is not mentioned in default list.
1st problem: docker-php-ext-* does not provide a way to install extension package from pecl (for example i need to install ext-mongo which cause me to make some tricks with Dockerfile to succeed) 2nd problem: custom source extensions (e.g. phalcon) that has to be compiled from scratch and exposed to runnin php daemon (fpm, apache).
Is there any instructions to make it right and simple? For any of cases.
Thanks.
'''
RUN pecl install xdebug-beta &&
docker-php-ext-enable xdebug
'''
thank you @ekandreas :+1:
This works great, thanks @luiscoms
# Enable and configure xdebug
RUN pecl install xdebug
RUN docker-php-ext-enable xdebug
Thanks for all the discussion and useful information! I'm closing since there's nothing to change in the image (given that the existing scripts handle this reasonably well), but this thread should serve as a useful reference for folks looking for help doing this kind of thing in the future. :+1:
I have a project using old mongo extension which is deprecated . Unable to install by pecl. Got a error message "No releases for package "pecl/mongo" exist" when I tried to install mongo extension by running
pecl install mongo
I end up install mongo extension manually. Below is work for me.
RUN apt-get update \
&& apt-get -y install libssl-dev \
&& curl -L -o /tmp/mongo.tar.gz https://github.com/mongodb/mongo-php-driver-legacy/archive/1.6.14.tar.gz \
&& tar xfz /tmp/mongo.tar.gz -C /tmp/ \
&& mkdir -p /usr/src/php/ext/mongo \
&& mv /tmp/mongo-php-driver-legacy-1.6.14/* /usr/src/php/ext/mongo \
&& rm -r /tmp/mongo.tar.gz /tmp/mongo-php-driver-legacy-1.6.14 \
&& cd /usr/src/php/ext/mongo \
&& phpize \
&& ./configure \
&& make all \
&& docker-php-ext-install mongo\
&& docker-php-ext-enable mongo\