Hi!
FROM php:7.1.17-apache-stretch
I installed bcmath with this command :
RUN docker-php-ext-install bcmath
No problem with the build but container running I could not see bcmath in the phpinfo()
And i'v this error when I try to send a mail :
(1/1) LogicException
The BCMath functions must be enabled to use the NTLM authenticator.
I try too to change in php.ini bcmath.scale = 0 to bcmath.scale = 2 and a restart
Have you ideas? Thank you!
bcmath installs correctly
FROM php:7.1.17-apache-stretch
RUN docker-php-ext-install bcmath
$ docker build . -t php:test
Sending build context to Docker daemon 6.656kB
Step 1/2 : FROM php:7.1.17-apache-stretch
---> 0157743b609e
Step 2/2 : RUN docker-php-ext-install bcmath
---> Using cache
---> edca8fe4b763
Successfully built edca8fe4b763
Successfully tagged php:test
$ docker run -it php:test bash
root@5d3789f02c6e:/var/www/html# php -m | grep bcmath
bcmath
root@5d3789f02c6e:/var/www/html# php -i | grep bcmath
Additional .ini files parsed => /usr/local/etc/php/conf.d/docker-php-ext-bcmath.ini
bcmath
bcmath.scale => 0 => 0
However I don't know what file the bcmath.scale is located in. Also if you want to modify a configuration file you'll have to mount it, either through COPY in the Dockerfile or other mounting options
Thank you for your back!
I tryed your commands and it's OK for your Exemple but not to my project.
I don't see where is my error...
`Building php-apache
Step 1/27 : FROM php:7.1.17-apache-stretch
---> 0157743b609e
Step 2/27 : RUN echo "deb http://ftp.de.debian.org/debian stretch main " > /etc/apt/sources.list
---> Using cache
---> c542231dca13
Step 3/27 : RUN apt-get update
---> Using cache
---> eb3b95d26686
Step 4/27 : RUN apt-get install -y nano unzip curl apt-utils re2c libicu-dev/stretch --allow-downgrades g++ zlib1g zlib1g-dbg zlib1g-dev zlibc
---> Using cache
---> 3236cd9b0d6a
Step 5/27 : RUN mkdir Download && cd Download && curl -sL https://deb.nodesource.com/setup_6.x && apt install -y nodejs
---> Using cache
---> ff5a6e64bede
Step 6/27 : RUN docker-php-ext-install bcmath
---> Using cache
---> fc3f4da2fd2d
Step 7/27 : RUN docker-php-ext-install fileinfo
---> Using cache
---> 3f9df5a8a02c
Step 8/27 : RUN docker-php-ext-install json
---> Using cache
---> a97b13fecb57
Step 9/27 : RUN docker-php-ext-install mbstring
---> Using cache
---> 024527e71a01
Step 10/27 : RUN docker-php-ext-install mysqli
---> Using cache
---> 196bffb12568
Step 11/27 : RUN docker-php-ext-install opcache
---> Using cache
---> d139ced1548e
Step 12/27 : RUN docker-php-ext-install pdo
---> Using cache
---> eb99ac34722a
Step 13/27 : RUN docker-php-ext-install pdo_mysql
---> Using cache
---> d17bcccd00cb
Step 14/27 : RUN docker-php-ext-install -j "$(nproc)" zip
---> Using cache
---> 1efef041566c
Step 15/27 : RUN docker-php-ext-configure intl && docker-php-ext-install intl
---> Using cache
---> a1c0ad7376ac
Step 16/27 : RUN apt-get install -y libssl-dev/stretch --allow-downgrades
---> Using cache
---> df3fe0df465b
Step 17/27 : RUN apt-get update && apt-get install libldap2-dev -y && rm -rf /var/lib/apt/lists/* && docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ && docker-php-ext-install ldap
---> Using cache
---> d753a3d8097e
Step 18/27 : RUN apt-get update && apt-get install -y libxml2-dev/stretch && CFLAGS="-I/usr/src/php" docker-php-ext-install xmlreader && docker-php-ext-install xmlwriter && apt-get purge -y --auto-remove libxml2-dev && rm -r /var/lib/apt/lists/*
---> Using cache
---> 74279ece31f9
Step 19/27 : RUN apt-get update
---> Using cache
---> 45ca34fa9a0c
Step 20/27 : RUN apt-get install -y libc-client2007e-dev
---> Using cache
---> 228c9fcc2870
Step 21/27 : RUN apt-get install -y libkrb5-dev
---> Using cache
---> 5b7811677fea
Step 22/27 : RUN mkdir /usr/kerberos && ln -s /usr/lib/x86_64-linux-gnu/mit-krb5/* /usr/kerberos
---> Using cache
---> d396355058da
Step 23/27 : RUN docker-php-ext-configure imap --with-imap-ssl --with-kerberos && docker-php-ext-install imap
---> Using cache
---> 8aaca7c7ded5
Step 24/27 : RUN apt-get update && apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libpng-dev && docker-php-ext-install -j$(nproc) iconv mcrypt && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && docker-php-ext-install -j$(nproc) gd
---> Using cache
---> f26c136a9da1
Step 25/27 : RUN apt-get update && apt-get install -y libenchant-dev
---> Using cache
---> c9b595e2a2f5
Step 26/27 : RUN apt-get install -y wget && wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz && tar -xvzf ioncube_loaders_lin_x86-64.tar.gz && cd ioncube && cp ioncube_loader_lin_7.1.so /var/www/html
---> Using cache
---> 7b2b6a7fd3fd
Step 27/27 : RUN apt-get install -y locate && updatedb && a2enmod rewrite
---> Using cache
---> b6b76277f334
Successfully built b6b76277f334
Successfully tagged test_php-apache:latest`
docker exec -it cerise_test_apache bash
php -m | grep bcmath
Empty
php -i | grep bcmath
Empty
FROM php:7.1.17-apache-stretch
RUN echo "deb http://ftp.de.debian.org/debian stretch main " > /etc/apt/sources.list
RUN apt-get update
RUN apt-get install -y nano unzip curl apt-utils re2c libicu-dev/stretch --allow-downgrades g++ zlib1g zlib1g-dbg zlib1g-dev zlibc
RUN mkdir Download && cd Download && curl -sL https://deb.nodesource.com/setup_6.x && apt install -y nodejs
RUN docker-php-ext-install bcmath fileinfo json mbstring mysqli opcache pdo pdo_mysql
RUN docker-php-ext-install -j "$(nproc)" zip
RUN docker-php-ext-configure intl && docker-php-ext-install intl
RUN apt-get install -y libssl-dev/stretch --allow-downgrades
RUN apt-get update && apt-get install libldap2-dev -y && rm -rf /var/lib/apt/lists/* && docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ && docker-php-ext-install ldap
RUN apt-get update && apt-get install -y libxml2-dev/stretch && CFLAGS="-I/usr/src/php" docker-php-ext-install xmlreader && docker-php-ext-install xmlwriter && apt-get purge -y --auto-remove libxml2-dev && rm -r /var/lib/apt/lists/*
RUN apt-get update
RUN apt-get install -y libc-client2007e-dev libkrb5-dev
RUN mkdir /usr/kerberos && ln -s /usr/lib/x86_64-linux-gnu/mit-krb5/* /usr/kerberos
RUN docker-php-ext-configure imap --with-imap-ssl --with-kerberos && docker-php-ext-install imap
RUN apt-get update && apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libpng-dev && docker-php-ext-install -j$(nproc) iconv mcrypt && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && docker-php-ext-install -j$(nproc) gd
RUN apt-get update && apt-get install -y libenchant-dev
RUN apt-get install -y wget && wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz && tar -xvzf ioncube_loaders_lin_x86-64.tar.gz && cd ioncube && cp ioncube_loader_lin_7.1.so /var/www/html
RUN apt-get install -y locate && updatedb && a2enmod rewrite
$ docker run --rm -dit --name php php:test
$ docker exec -it php bash
root@b5234b58c578:/var/www/html# php -m | grep bcmath && php -i | grep bcmath
bcmath
Additional .ini files parsed => /usr/local/etc/php/conf.d/docker-php-ext-bcmath.ini,
bcmath
bcmath.scale => 0 => 0
Thank you for your help @wglambert.
Effectively, in a new environment I've the same output of you.
So, I will close and search around the php.ini but I changed only the php.ini to enable gd and pdo_mysql.
I think about only that... Data in www could not remove bcmath...!
OK I found !
So when we run:
RUN docker-php-ext-install bcmath for exemple.
That's create a file docker-php-ext-bcmath.ini in /usr/local/etc/php/conf.d!!!!
As I mounted a volume conf-php and I put a php.ini in all docker-php-bcmath was crushed.
Thank you another time @wglambert! Next time I will use COPY!
Most helpful comment
OK I found !
So when we run:
RUN docker-php-ext-install bcmathfor exemple.That's create a file docker-php-ext-bcmath.ini in /usr/local/etc/php/conf.d!!!!
As I mounted a volume conf-php and I put a php.ini in all docker-php-bcmath was crushed.
Thank you another time @wglambert! Next time I will use COPY!