vercel-community / php

🐘 PHP Runtime for ▲ Vercel Serverless Functions (support 7.4-8.3)
https://php.vercel.app
MIT License
1.26k stars 293 forks source link

Ability to install additional CLI packages? #368

Open DenverCoder1 opened 1 year ago

DenverCoder1 commented 1 year ago

Is it currently possible to tell Vercel to install additional packages to be made available at runtime?

I am not referring to packages installable via Composer, but rather ones you would install for use on the command line.

For example, if I wanted to run inkscape via shell_exec, would I be able to tell Vercel to install the inkscape package and avoid getting the sh: line 98: inkscape: command not found error?

f3l1x commented 1 year ago

Hi. There is build phase and runtime phase. During build phase we can install anything you want. But during runtime phase is it problematic. Is inkscape single binary without dependencies?

DenverCoder1 commented 1 year ago

Thanks for taking a look.

Not sure about dependencies, but it seems there are a few options including an executable Appimage.

https://inkscape.org/release/inkscape-1.2.2/

DenverCoder1 commented 1 year ago

Any update on this?

Is there anything I can do to get inkscape installed?

Or, if not, is it possible to get the Imagick PHP extension?

Thanks!

f3l1x commented 1 year ago

Hi @DenverCoder1, I don't the the easy way how to do it right now.

DenverCoder1 commented 1 year ago

Ok, no problem.

On Heroku, I was able to add third party buildpacks that can install things. I have gotten inkscape working there by adding the buildpack https://github.com/heroku/heroku-buildpack-apt and having an Aptfile with "inkscape" as the contents.

Is it possible to install apt packages listed in a file with Vercel? I'm not really sure how Vercel's runtime works.

f3l1x commented 1 year ago

Aptfile would be great, but it's not possible right now.

DenverCoder1 commented 1 year ago

Okay, I'll look forward to hearing if you do find a good solution. 👍

f3l1x commented 1 week ago

It's still not possible.