Question

How to install php7.4-gd in App Platform container?

Is there a way to install php7.4-gd in the default container build step?

I´ve tried:

sudo apt-get install -y php7.4-gd

Unfortunately I´m getting an error:

sudo: effective uid is not 0, is /usr/bin/sudo on a file system with the 'nosuid' option set or an NFS file system without root privileges?

Without sudo:

E: List directory /var/lib/apt/lists/partial is missing. - Acquire (13: Permission denied)
Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

You can install the GD extension by adding ext-gd to composer.json like so:

composer.json
{
    "require": {
        "ext-gd": "*"
    }
}

The PHP build environment uses the Heroku PHP Buildpack, so you can refer to the official documentation for more information.