2

I'm using the flatpak version of Atom. I want to install a linting package for PHP, so that code errors are easier to spot. However it requires access to a php binary.

Now since this is a Flatpak, it's sandboxed so no chance of me giving it proper access to the /usr/bin directory any time soon, but I discovered I could use a Flatpak runtime of PHP 7.4 called org.freedesktop.Sdk.Extension.php74, which should provide me with what I need.

The only question that's left for me is how do I pass this to the package? The setting I'm provided with is a path text field, where I'd normally pass it the /usr/bin/php path, but how do I invoke the flatpak equivalent to that?

1 Answers1

0

So I found some closure with this and here's what I found.

It turns out the correct way to pass php, for example, is to add it with the path /var/run/host/usr/bin/phpX.X, where X.X is the particular version of PHP you would have. In my case it was /var/run/host/usr/bin/php8.0.

Because the Flatpak sandbox mounts the /usr directory in a limited manner, to allow flatpaks access to certain system binaries they might need, running just the equivalent of /usr/bin/php would not be sufficient, the specific binary with the specific version number is required.

There is, however, still an issue. The Flatpak sandbox itself appears to not mount things properly, I believe this is a known issue. Two php libraries - libargon2 and libsodium are not found by the PHP binary. I attempted to change the LD_LIBRARY_PATH to try properly include them, but to no avail.

This problem persisted with PHP versions as far back as 7.1.

In the end I moved to the Debian package of Atom, since I cannot figure this out, but if this issue gets resolved in the Flatpak sandbox, I'll be moving back to that and the solutions above are more than sufficent.