Installing php with extensions?

Flox is super interesting! I’m new to both nix and flox and I’m trying to install php plus some extensions into my flox project, but the php81Extensions.yaml package doesn’t enable the php extension unlike others say php81Extensions.sqlite3 package.

You can replicate this through flox pull svandragt/lamb; flox activate; php -m
You’ll note that yaml is not in the list but sqlite3 is.

I had to add priorities to all the packages because of a conflict installing subsequent php extensions, in case that’s relevant:

Both packages provide the file ‘/include/config.h’
Resolve by uninstalling one of the conflicting packagesor setting the priority of the preferred package to a value lower than

Is this the correct way to install PHP extensions? For example NixPkgs seems to do custom builds? Is this a problem with the officially maintained extension or with my workflow?

Thanks for your help :slight_smile:

Flox doesn’t yet expose a custom build but this might be what’s required to get your extension to behave properly. In the event you get stuck here it can still be useful to use Flox to manage 1/ getting the right version of php 2/ any OS dependencies your extensions will need and 3/ getting a tool-specific package manager (like composer) to fetch the extension you need in the tool’s native way.

will look into what’s going on with the extensions and ask around a bit but if the answer is the build we do have plans to extending Flox in this direction soon!

ah ok in that case I might need to install PECL. Thanks Ghudgins I’ll follow up if I have an update.

1 Like

For future reference: Ok it turns out that installing flox install php already installs PHP with a list of common extensions, but not yaml.

So when I checked the requested php81Extensions.* package was available in the interpreter I was checking against the standard install, none of the extensions I installed using flox install php81Extensions.$name actually got enabled.