I'm having troubble installing the gmp extension on my docker image. My docker file looks like:
FROM php:7.4-fpm-alpine
RUN docker-php-ext-install pdo pdo_mysql gmp
When I run this docker file I get the error:
configure: error: GNU MP Library version 4.2 or greater required.
ERROR: Service 'php' failed to build : The command '/bin/sh -c docker-php-ext-install pdo pdo_mysql gmp' returned a non-zero code: 1
I've tried the solution on this stackoverflow post, however it did not work for me.
Any ideas on how I can resolve this?
GMP stands for GNU Multiple Precision Arithmetic Library (GMP). GMP is a library supported in PHP that allows you to do mathematical operations on signed integers, rational numbers, and floating point numbers. GMP has a rich collection of functions that helps to perform complex mathematical operations on big numbers.
You don't need to make any changes to the PHP or NGINX configuration on the new server. You don't even need to install PHP or NGINX on the server itself. They'll be automatically installed by Docker when you launch the application. You can run the exact same image on your development machine.
Installing PHP 7.4 On Docker. With the release of PHP 7.4 (today)… | by Devin Dixon | Helium MVC | Medium With the release of PHP 7.4 (today), the language has some great updates that can improve development. These changes include: Many more… You may want to get it running on your local docker before deploying to production.
You are hitting what opencontainers/runc#2750 fixes, so you need an updated docker; 20.10.4 and above includes the updated runc. Sorry, something went wrong. Looks like you are all running into the exact issue our build servers were hitting last week.
Like the error says: configure: error: GNU MP Library version 4.2 or greater required. You can install GNU MP ( GMP for short) on Alpine Linux by including the following in your Dockerfile:
Like the error says: configure: error: GNU MP Library version 4.2 or greater required.
You can install GNU MP (GMP
for short) on Alpine Linux by including the following in your Dockerfile:
RUN apk add gmp-dev
(or RUN apt-get install gmp-dev
for other debian distros)
I spent half an hour on this, so just to clarify for anyone that is looking for a solution: adding these lines to the Dockerfile for php7.4 worked:
RUN apt-get install -y libgmp-dev
RUN docker-php-ext-install gmp
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With