configure: error: Unable to locate gmp.h

Per I tried the following to no avail:

  • ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h
  • --with-gmp=/usr/include/x86_64-linux-gnu

Both of them get me this error:

configure: error: Unable to locate gmp.h

When I do ln /usr/include/x86-64-linux-gnu/ I see this:

a.out.h asm bits c++ fpu_control.h gmp.h gnu ieee754.h sys

Any ideas?

5

3 Answers

Have you tried

ls /usr/include/x86_64-linux-gnu/gmp.h

Please make sure whether the gmp.h file exists.

Maybe you should run the following command:

sudo apt-get install libgmp-dev

just in case someone having same issue while trying to compile php via phpbrew, although /usr/include/x86_64-linux-gnu/gmp.h is definitely there and available:

symlink for gmp.h solved this for me

ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h
2

Had the same problem in a Debian/PHP Docker container when running:

RUN docker-php-ext-install gmp

This fixed it for me (run it before the docker-php-ext-install command):

RUN apt-get update && apt-get install -y libgmp-dev
RUN ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h
1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like