Installing GMP on docker using lando

I’m trying to spin up a laravel instance via lando using php8.
I also need to install the php GMP module…
I’m very new to docker and lando.

Now it seems as though the php instance that lando uses does not have GMP pre-setup

I found a post somewhere where someone installed some php modules via the lando file and tried to modify my file based on that.

This is my lando file at the moment:

name: og-tools
recipe: laravel
  webroot: public
  composer_version: 2
  database: mariadb
  cache: redis
    type: php:8.0
    via: apache
      - apt-get update -y
      - apt-get install php8.0-gmp
      - echo "" > /etc/php8/apache2/conf.d/gmp.ini
    type: mailhog
    portforward: true
      - appserver

When I try running it I get the following:
E: Unable to locate package php8.0-gmp
E: Couldn't find any package by glob 'php8.0-gmp'
E: Couldn't find any package by regex 'php8.0-gmp'
ERROR ==> E: Couldn't find any package by regex 'php8.0-gmp'

However looking up PHP8 GMP searches lead me to this site:

They mention the package php8.0-gmp however I don’t seem to be able to find it.

I could just be doing this all completely wrong, I’m a little out of my depth for the time being and trying to learn as I go


Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Thanks to one of the guys over on the lando slack, this is the solution he gave me which works:

      - apt update && apt install libgmp-dev -y && docker-php-ext-install gmp

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Notify of

Inline Feedbacks
View all comments
Would love your thoughts, please comment.x