Open konnorov opened 4 years ago
Hey @konnorov. GD extension is not bundled in now-php. It requires so many shared libs and Vercel's limit is about 50mb per lambda.
Sad :(
Are there any other ways to add text to photos supported by ZEIT?
I see few options here.
@f3l1x If I add gd to php.ini, will it work? Do you have any examples on how to add an extension to vercel/php?
Hi @WilliamBlais. Problem is not PHP ini, but GD extension it self. It looks like it requires so much filespace (filesize) and many shared libraries installed on platform. We are limited by 50 MB per 1 lambda. So, GD extension is not supported at this moment.
Take a look at FAQ (https://github.com/juicyfx/vercel-php#%EF%B8%8F-faq), there is example how to edit php.ini.
@f3l1x @WilliamBlais
Please I encounter this issue, have you find any solution for it?
Hey @f3l1x Found that the gd extension it is present in an older version Here Would it be possible to include it ? or a way to make it work ? I keep getting the error below when using the older vercel-php version which uses that extension during build
Error: The Runtime @vercel/vc-build is using nodejs12.x, which was discontinued by an upstream provider. In turn, we have to ask you to upgrade your Runtime to a more recent version or consult the author for more details.
Hi @sonaxa and @Jobians, there is a problem with size of the lambda.
Problem is not PHP ini, but GD extension it self. It looks like it requires so much filespace (filesize) and many shared libraries installed on platform. We are limited by 50 MB per 1 lambda. So, GD extension is not supported at this moment.
Imagick is included in the server image, so you can generate thumbnails with spatie/image
library or any other library that supports ext-imagick
instead of ext-gd
. I was able to create thumbnails and watermarks with my Laravel app, you just need to remember to save all the images to the /tmp
folder and then if you want to keep them, upload it to S3 afterwards or another storage provider.
My process was
You can also add text with spatie/image
so I'm sure it's possible with other libraries that support imagick
.
How can I remove the error:
Fatal error: Uncaught Error: Call to undefined function imagecreatefrompng() in /var/task/user/api/image.php:8 Stack trace: #0 {main} thrown in /var/task/user/api/image.php on line 8
help plz(