Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't installl php7.0-gmp into php-fpm container... #652

Closed
sasokovacic opened this issue Mar 4, 2017 · 6 comments
Closed

Can't installl php7.0-gmp into php-fpm container... #652

sasokovacic opened this issue Mar 4, 2017 · 6 comments

Comments

@sasokovacic
Copy link

it can be done for every other version of linux but not for jessie... or am I missing something?
I've tried everything without success... I really need this for a project I'm working on...

@sasokovacic sasokovacic changed the title Can't installl gmp7.0 into php-fpm container... Can't installl php7.0-gmp into php-fpm container... Mar 4, 2017
@kahunacoder
Copy link

I needed gmp too but when I installed it using laradock fpm that I modified, I kept getting an error saying gmp.h couldn't be found.

I added this to Dockerfile-70

#####################################
# GMP:
#####################################

ARG INSTALL_GMP=false
RUN if [ ${INSTALL_GMP} = true ]; then \
    # Install the gmp extension
    apt-get update && \
    apt-get -y install libgmp-dev && \ 
    docker-php-ext-install gmp \
;fi

and changed this FROM to
FROM laradock/php-fpm:7.1--1.3

This didn't work. So I added my own dockerfile to laradock fpm, it installs a lot of extensions and their required libraries. I don't know what my file added that was missing in the modified Dockerfile-70 but here is my custom dockerfile.

FROM php:fpm

RUN apt-get update && apt-get install -y \
        libjpeg62-turbo-dev \
        libmcrypt-dev \
        libpng12-dev \
		libcurl4-gnutls-dev \
		libxml2-dev \
		libbz2-dev \
		re2c \
		libpng++-dev \
        libpng3 \
        libjpeg-dev \
        libvpx-dev \
        zlib1g-dev \
        libgd-dev \
        libssl-dev \
        libtidy-dev \
        libxslt1-dev \
        libmagic-dev \
        libexif-dev \
        file \
        libssh2-1-dev \
        git \
        wget	\
		sqlite3	\
		libsqlite3-dev \
		libgmp-dev \


	&& docker-php-ext-install json \
	&& docker-php-ext-install mbstring \
	&& docker-php-ext-install tokenizer \
    && docker-php-ext-install gmp \
    && docker-php-ext-install gd \
	&& docker-php-ext-install curl \
	&& docker-php-ext-install dom \
	&& docker-php-ext-install bz2 \
	&& docker-php-ext-install mysqli \
	&& docker-php-ext-install pcntl \
	&& docker-php-ext-install pdo \
	&& docker-php-ext-install pdo_mysql \
	&& docker-php-ext-install phar \
	&& docker-php-ext-install posix \
	&& docker-php-ext-install simplexml \
	&& docker-php-ext-install soap \
	&& docker-php-ext-install sockets \
	&& docker-php-ext-install tidy \
	&& docker-php-ext-install zip \
	&& docker-php-ext-install bcmath \
	&& docker-php-ext-install calendar \
	&& docker-php-ext-install ctype \
	&& docker-php-ext-install exif \
	&& docker-php-ext-install pcntl \
	&& docker-php-ext-install pdo_sqlite

@sasokovacic
Copy link
Author

sasokovacic commented Mar 14, 2017

Thanks for your answer... Today I found shorter solution on https://hub.docker.com/r/ianblenke/simplesamlphp/~/dockerfile/

RUN apt-get update -y
RUN apt-get install -y libgmp-dev re2c libmhash-dev libmcrypt-dev file
RUN ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/local/include/
RUN docker-php-ext-configure gmp 
RUN docker-php-ext-install gmp

and it works...
you can ignore mcrypt if you don't need it...

@steinkel
Copy link

The provided link is 404 now, but the fix worked for me when dealing with a similar issue in a .gitlab-ci.yml file, Thanks!

@mkantautas
Copy link

mkantautas commented Jun 25, 2018

php -i | grep gmp Shows the gmp installed on php-fpm, but not on workspace from where I install my composer packages, not sure why both the documented recipe and @sasokovacic fails to do its job.

@jayenne
Copy link

jayenne commented Dec 27, 2020

I've set all the GPM's to true in the laradock env file and rebuilt. phpinfo is showing it enabled but I'm still getting an error saying it's not there (webpush notifcations failing). also 'php -i | grep gmp' shows nothing in workspace but fine from outside docker workspace.

any thoughts?

@Dsantacruz
Copy link

Dsantacruz commented Jan 6, 2021

@sasokovacic , this solutions works for me

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

No branches or pull requests

7 participants