当在laravel上使用干预\映像时,出现了以下错误。顺便说一句,它在当地的环境中工作。
我得加个gd。
2021-08-17 10:37:18 DEV.ERROR: GD库扩展不可用。{“例外”:“object”
我所看到的
https://bref.sh/docs/environment/php.html#extensions https://github.com/brefphp/extra-php-extensions
展开法
我们正在使用sls命令部署到lambda。
sls部署-阶段开发
在调查的基础上,实施了以下几点:
编写器需要bref/ composer扩展
添加在serverless.yml下面
plugins:
- ./vendor/bref/bref
- ./vendor/bref/extra-php-extensions #add
functions:
# This function runs the Laravel website/API
web:
image:
name: laravel
events:
- httpApi: '*'
# This function lets us run artisan commands in Lambda
artisan:
handler: artisan
timeout: 120 # in seconds
layers:
- ${bref:layer.php-80}
- ${bref:layer.console}
- ${bref-extra:gd-php-80} #add即使添加和部署了上述设置,也不会更新这些设置。。。为什么?
环境
如果英语很奇怪,我很抱歉。
发布于 2022-04-21 01:03:02
将图层放入网页“标签”。
plugins:
- ./vendor/bref/bref
- ./vendor/bref/extra-php-extensions #add
functions:
# This function runs the Laravel website/API
web:
image:
name: laravel
layers:
- ${bref-extra:gd-php-80} #add
events:
- httpApi: '*'
# This function lets us run artisan commands in Lambda
artisan:
handler: artisan
timeout: 120 # in seconds
layers:
- ${bref:layer.php-80}
- ${bref:layer.console}然后在里面添加php/conf.d .d文件夹,放入扩展名为.ini的文件。例如,php.ini。在里面只写了:
extension=gdhttps://stackoverflow.com/questions/68941975
复制相似问题