Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to install other extension in it? #399

Open
xuanxuan1231 opened this issue Feb 25, 2023 · 3 comments
Open

How to install other extension in it? #399

xuanxuan1231 opened this issue Feb 25, 2023 · 3 comments

Comments

@xuanxuan1231
Copy link

Question

How to install other extension in it?
Like gd

@SchramlTim
Copy link

There are many requests like this @f3l1x . There seems to be a need for case specific runtimes.
I have two suggestions for this (I have read the other problems with the GD Extention, this is just an example):

  1. we consider if it is possible to add the extensions in a plugin system. For this I would have imagined that build a NPM module for each extension and then references not only the amazon-linux-php package via package.json but also the desired extension.
    This could look like this:
"dependencies": {
    "@libphp/amazon-linux-2-v81": "latest",
    "@libphp/gd-v81": "latest"
},

To consider is that it is then necessary to generate the php.ini based on the packages that you have installed.

  1. I would offer to write a pull request with a guide, how to create a runtime with the special extention. I think that this repo should be a general base and not cover all possible cases.

@f3l1x
Copy link
Collaborator

f3l1x commented Mar 27, 2023

Hi @SchramlTim.

Ad 1) This could be a great way how to install extra packages. However, I am not sure if it would be still possible, because we need to fit to 50Mb lambda size.

Ad 2) We can have a manual for that. But creating a new runtime could be challenge for someone.


Ad 3) I heard that Vercel will support lambda layers someday. It could solve all troubles with these extensions. Just like brefphp do it.

Ad 4) I can imagine way there is a full-bloated-libphp package with all possible extensions and you can enable/disable them via ENV. Something like VERCEL_PHP_EXTENSIONS=json,pdo,gd or something like that. Going this way requires to track all extensions and their dependencies via ldd <extension.name.so> and add/remove files from resulting lambda compilation. It sounds as hardcore, but it's not that bad.

What do you think?

@SchramlTim
Copy link

Thanks for feedback!

  1. I will sit down in the near future and sketch out a solution. Then I have also a better impression which things are drivers for the increased MB size.

  2. Alright will do pull request with a basis for discussion

  3. Unfortunately, I am too little in the Lambda game. I'll read in :)

  4. Doesn't that also bump up against the lambda size limit? Otherwise I find the idea also very chic! The developer experience would thus lose complexity and push PHP for Vercel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants