docker-nginx-php-mysql icon indicating copy to clipboard operation
docker-nginx-php-mysql copied to clipboard

Problem: the requested PHP extension gd is missing from your system

Open kit2000usa opened this issue 7 years ago • 3 comments
trafficstars

I'm using this docker to build a website in laravel framework and I need to use dompdf library to install by composer.

I run this command:

sudo docker run --rm -v $(pwd)/web/app:/app composer require barryvdh/laravel-dompdf

and having the error:

dompdf/dompdf v0.8.2 requires ext-gd * -> the requested PHP extension gd is missing from your system. .....

I have checked the docker which includes GD library but I have no idea why this error comes out.

I googled a lot and found this guy was having the same problem in here:

https://github.com/composer/composer/issues/5749

Do you guys have any suggestion how to fix this issue in this docker???

kit2000usa avatar Jun 14 '18 17:06 kit2000usa

This is an issue with the Docker image for Composer: https://github.com/composer/docker/issues/38 They won't fix it because it's just a Composer error that prevents you from installing dependencies that your PHP can't run.

The nanoninja/php-fpm image does contain the required libs.

So we best follow the suggestion from the issue above, and replace the command: install line as follows:

  composer:    
        ...
        command: install --ignore-platform-reqs

Harti avatar Jul 01 '18 09:07 Harti

This is an issue with the Docker image for Composer: composer/docker#38 They won't fix it because it's just a Composer error that prevents you from installing dependencies that your PHP can't run.

The nanoninja/php-fpm image does contain the required libs.

So we best follow the suggestion from the issue above, and replace the command: install line as follows:

  composer:    
        ...
        command: install --ignore-platform-reqs

you saved my life.

rahgurung avatar Sep 19 '18 13:09 rahgurung

@Harti thanks for your contribution, I should add it in the PHP-FPM images

nanoninja avatar Sep 24 '20 12:09 nanoninja