!jngDrdMgndWibPCYsR:nixos.org

Nix PHP

81 Members
A room for PHP developers running on Nix23 Servers

Load older messages


SenderMessageTime
2 Mar 2023
@berksmbl:matrix.orgBerk SümbülHello, We are having a problem and none of the solutions I have tried have worked. https://github.com/railwayapp/nixpacks/issues/63909:18:46
@berksmbl:matrix.orgBerk SümbülDo you have any solution suggestions?09:19:13
@drupol:matrix.orgPolHey hello09:34:30
@berksmbl:matrix.orgBerk Sümbül
In reply to @drupol:matrix.org
Hey hello
Hi!
09:35:02
@drupol:matrix.orgPolI read the thread.09:35:10
@drupol:matrix.orgPolInstalling the extension won't make PHP find the extension.09:35:24
@drupol:matrix.orgPolYou need to build a specific version of PHP including mongodb extension09:35:34
@drupol:matrix.orgPolI just tried with my own package and it works immediately09:36:38
@drupol:matrix.orgPolDo the following:09:36:44
@drupol:matrix.orgPol Create a file: composer.json and add in it: { "require": { "ext-mongodb": "*" } } 09:37:07
@berksmbl:matrix.orgBerk Sümbülhttps://github.com/railwayapp/nixpacks/blob/main/src/providers/php/mod.rs#L6609:37:19
@drupol:matrix.orgPol Then do: nix shell github:loophp/nix-shell#env-php81 --impure in the directory where the composer.json has been created. 09:37:52
@drupol:matrix.orgPol I don't know that mod.rs, I just know how Nix is working. 09:38:48
@drupol:matrix.orgPol(or at least trying to ! )09:38:55
@berksmbl:matrix.orgBerk Sümbül
In reply to @berksmbl:matrix.org
https://github.com/railwayapp/nixpacks/blob/main/src/providers/php/mod.rs#L66
After this line, I added something like this to activate the plugin, but I couldn't get any results.
09:39:07
@berksmbl:matrix.orgBerk Sümbül pkgs.push(Pkg::new(&format!("{}.withExtensions (pe: pe.enabled ++ [pe.all.{extension}])", &php_pkg))); 09:39:17
@drupol:matrix.orgPol You need to use php.buildEnv... 09:40:05
@drupol:matrix.orgPolLook at this page: https://nixos.wiki/wiki/PHP09:40:09
@berksmbl:matrix.orgBerk Sümbül * pkgs.push(Pkg::new(&format!("({}.withExtensions (pe: pe.enabled ++ [pe.all.{extension}]))", &php_pkg))); 09:40:23
@drupol:matrix.orgPol
pkgs.php.buildEnv {
    extensions = ({ enabled, all }: enabled ++ (with all; [
      mongodb
    ]));
}
09:40:42
@drupol:matrix.orgPolThis will work.09:40:56
@berksmbl:matrix.orgBerk Sümbül
In reply to @drupol:matrix.org
Look at this page: https://nixos.wiki/wiki/PHP
I just looked at all of them.
09:41:01
@drupol:matrix.orgPolThis is the reason why I made https://github.com/loophp/nix-shell/09:41:20
@drupol:matrix.orgPol I wanted something that reads the composer.json and build the proper PHP version for it. 09:41:33
@drupol:matrix.orgPol That said, php.withExtensions should work as well. 09:44:13
@drupol:matrix.orgPol
php = pkgs.php.withExtensions ({ enabled, all }:
  enabled ++ [ all.mongodb ]);
09:44:39
@berksmbl:matrix.orgBerk SümbülI don't know how to adapt this on nixpacks.09:45:48
@drupol:matrix.orgPolI don't know nixpacks yet sorry09:49:58
@berksmbl:matrix.orgBerk Sümbül
In reply to @drupol:matrix.org
Look at this page: https://nixos.wiki/wiki/PHP
* I've been dealing with this for 6 months, I've looked at all the documents. My native language is not English anyway and I might miss some things.
09:56:19
@etu:failar.nu@etu:failar.nuYeah, as far as I can see, the issue is not in nixpkgs, it's most probably in nixpacks11:04:09

Show newer messages


Back to Room ListRoom Version: 6