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

Future scope: compile/install shared objects into a folder within a PHP project #5

Open
Girgias opened this issue Feb 19, 2024 · 1 comment
Labels
question Further information is requested

Comments

@Girgias
Copy link

Girgias commented Feb 19, 2024

As discussed with @asgrim at PHP UK 2024.

The idea would be to install the shared object resulting from the compilation of the extension into a folder within the PHP project.
This would be similar to the /vendor/ folder composer creates and uses for dependencies.

The motivation for this is to allow different version of an extension to be installed for different projects, as those might not all be compatible with newer versions of a given extension.

What is probably needed is a generated INI file that is passed to PHP to load the .so at startup.

@asgrim
Copy link
Collaborator

asgrim commented Feb 19, 2024

I'm a big fan of this idea; however, thinking a bit more this, I think the unknown for me is how we can scope loading the shared object depending on the project. In something like a Dockerfile, there's less of an issue (since you'd usually scope your Dockerfile to an individual project and its specific requirements), but that's a small subset of applications, I'd guess.

I think off my head it is possible for PHP modules to be loaded per project (e.g. have a .user.ini) but this doesn't always work (I think in FPM mode, for example).

The other thing to consider with this, is even if we were to scope it per project, would there be an effect on performance; since extensions can take advantage of MINIT/MSHUTDOWN to avoid doing loading/unloading of things on every request, or having cross-request persistence and so on; it would essentially make every single request sequence MINIT,RINIT,RSHUTDOWN,MSHUTDOWN, which doesn't feel very efficient.

@asgrim asgrim added the question Further information is requested label May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants