Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

johndoee's avatar

php gd extension problem in ubuntu

I try to update composer but the problem is here

Problem 1
    - phpoffice/phpspreadsheet[1.18.0, ..., 1.23.0] require ext-gd * -> it is missing from your system. Install or enable PHP's gd extension.
    - Root composer.json requires phpoffice/phpspreadsheet ^1.18 -> satisfiable by phpoffice/phpspreadsheet[1.18.0, ..., 1.23.0].

I already installed gd

`` sudo apt-get install -y php-gd


already require composer

    "maatwebsite/excel": "^3.1",
    "phpoffice/phpspreadsheet": "^1.18",
but problem remian .
how can solve it.
0 likes
2 replies
sr57's avatar

@kyawswar

Have you more than one version of php installed?

Try sudo apt-get install -y php8.0-gd

if you use Php8.0 or change to the version you use.

1 like
siangboon's avatar

i think you may need to install the right version with your php version and try to restart the service after installed.

1 like

Please or to participate in this conversation.