nanoninja / docker-nginx-php-mysql

Docker running Nginx, PHP-FPM, MySQL & PHPMyAdmin
1.76k stars 867 forks source link

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

Open kit2000usa opened 6 years ago

kit2000usa commented 6 years ago

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???

Harti commented 6 years ago

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
rahgurung commented 5 years ago

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.

nanoninja commented 3 years ago

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