brefphp/extra-php-extensions

GD extension doesn't seems to install or enable

YannLeGuehennec opened this issue · 6 comments

Hello,

I have a problem when i try to deploy my project because i have this error
Problem 1 - Root composer.json requires PHP extension ext-gd * but it is missing from your system. Install or enable PHP's gd extension. Problem 2 - phpoffice/phpspreadsheet is locked to version 1.29.0 and an update of this package was not requested. - phpoffice/phpspreadsheet 1.29.0 requires ext-gd * -> it is missing from your system. Install or enable PHP's gd extension.

I then add the extra layer gd and i also add in my php/conf.d/php.ini the line to activate the extension
Serverless.yml
functions: app: handler: public/index.php timeout: 28 # in seconds (API Gateway has a timeout of 29 seconds) layers: - ${bref:layer.php-81-fpm} - ${bref-extra:sqlsrv-php-81} - ${bref-extra:gd-php-81} events: - httpApi: '*'

Composer.json
"php": ">=8.0.2", "bref/bref": "^1.7.27", "bref/extra-php-extensions": "^0.12.4", "phpoffice/phpspreadsheet": "^1.29",

I try to downgrade phpspreadsheet but it doesn't work, i see bref can have a maximum of 5 layer but i don't know if the are common between the function because i have another function in serverless wich is use for my command
console: handler: bin/console timeout: 120 #in seconds layers: - ${bref:layer.php-81-fpm} - ${bref:layer.console} - ${bref-extra:sqlsrv-php-81} - ${bref-extra:calendar-php-81} - ${bref-extra:gd-php-81}

I'm on symfony if it can help

First time i create an issue so sorry if i'm not in the right place to ask something
Thanks in advance

It seems you added the layer, but that will add GD in Lambda, not on your machine. So when you run composer install on your machine you're missing GD.

Yeah but on my machine it work (i can make composer install and use the librairy), it crash on the github deployment i don't know if the problem come from the lambda or maybe from the github action.

I'm kind of stuck on how to debug this problem, i ask my lead dev but he also has no idea i will try to remove some layer (some of them are not use anymore)

If you have an idea i'm open to it. Obviously it's an intern project and not a very large so i only have one server (prod)
Again thanks in advance

is it possible to maybe have access to the .ini of docker or something like this to see if the extension is add or maybe why it isn't ?

PS : sorry for the late answer (it's my professionnal git so i use it only at work)

it crash on the github deployment

ah that means GD is missing in GitHub Actions.

Ah so the problem mostly come from our github actions thanks.

I will try to make some tweaks with my lead dev, maybe you have any idea how to solve this problem ?
If not, thanks you again, even this help me advance in resolving my problem.

But i have a question if the problem come from the github actions it will probably create this type of error commonly no ?

You could run composer install --ignore-platform-reqs to ignore missing extensions

composer install --ignore-platform-reqs

Indeed it's works but if feels a bit like i just escape the problem.
nonetheless it's working, thank you for your time and answer (because it wasn't really a problem with bref)

You was a great help, wish you a good day ^^