!jngDrdMgndWibPCYsR:nixos.org

Nix PHP

73 Members
A room for PHP developers running on Nix21 Servers

Load older messages


SenderMessageTime
21 Nov 2023
@drupol:matrix.orgPolhaha09:25:41
@drupol:matrix.orgPolLet me show you the updated version09:25:48
@drupol:matrix.orgPol=> https://gist.github.com/drupol/117068bd346558407c4e99008ac1d00409:26:19
@drupol:matrix.orgPol
In reply to @rikudou:lemmings.world
Huh, that's weird. Why do I need to add it to the git index?
When there is a .git directory, flake will use it, and thus, it needs to be added to it.
09:26:45
@rikudou:lemmings.worldrikudou@lemmings.world Is _module some kind of special thing? 09:28:18
@drupol:matrix.orgPol I'm using flake-parts framework for making the Flake and abstracting the type of architecture. 09:30:11
@drupol:matrix.orgPolI invite you to check out their website09:30:24
@drupol:matrix.orgPolhttps://flake.parts/09:30:29
@drupol:matrix.orgPolThis is IMHO the best framework for making composable, extendable and reliable flake09:30:45
@rikudou:lemmings.worldrikudou@lemmings.worldI'll check it out09:31:26
@rikudou:lemmings.worldrikudou@lemmings.world The perSystem I assume is a function of flake-parts? 09:31:50
@drupol:matrix.orgPolyes, this is to abstract the architecture.09:34:58
@jtojnar:matrix.orgJan Tojnar
In reply to @stotes:matrix.org

I'm currently facing an issue with registering the php74Extensions.redis in my NixOS environment, and I'm seeking some guidance to resolve it.
I'm able to get xdebug to correctly register with the zend_extension = "${php.php74Extensions.xdebug}/lib/php/extensions/xdebug.so" and I've can see the redis.so exists in the nixstore path /nix/store/hnjkll3gvx7nm8i7vm1mc1cpa4b1p3lh-php-redis-5.3.4/lib/php/extensions/ for the php74Extensions.redis package. However phpinfo fails to register the redis package (xdebug is showing as expected and changed to the config or removing the xdebug.so entry reflect the phpinfo.)

Here's a brief overview of my configuration:

configuration.nix:

{ config, pkgs, lib, ... }:
let
  php = import
    (builtins.fetchTarball {
      url = "https://github.com/NixOS/nixpkgs/archive/2766f77c32e171a04d59b636a91083bae862274e.tar.gz"; #7.4.29 php
    })
    { };
in
{
  imports =
    [
      # Include the results of the hardware scan.
      ./hardware-configuration.nix
      (import /home/stotes/nix/server/nginx-php.nix { inherit config php lib pkgs; })
    ];
    # ... continues
}

nginx-php.nix:

{ config, pkgs, lib, php, ... }:
{
  environment.systemPackages = with php; [
    php.php74
    php.phpPackages.composer
    php.php74Extensions.pdo
    php.php74Extensions.redis
    php.php74Extensions.xdebug
  ];

  services.phpfpm.phpOptions = ''
    date.timezone = Australia/Brisbane
    extension = "${php.php74Extensions.redis}/lib/php/extensions/redis.so"
    zend_extension = "${php.php74Extensions.xdebug}/lib/php/extensions/xdebug.so"
  '';
}

nix-created php.ini entries:

date.timezone = Australia/Brisbane
extension = "/nix/store/hnjkll3gvx7nm8i7vm1mc1cpa4b1p3lh-php-redis-5.3.4/lib/php/extensions/redis.so"
zend_extension = "/nix/store/hsprflbbk5a0hqaysm7vaspqmn2l1nyg-php-xdebug-3.0.4/lib/php/extensions/xdebug.so"

Despite my configuration, the php74Extensions.redis package is not registering as expected. I've followed the NixOS documentation and community forums but couldn't find a solution. Can someone please guide me on what might be causing this issue or any steps I can take to troubleshoot it further?

Any help or insights would be greatly appreciated. Thank you in advance for your assistance!

replied on https://discourse.nixos.org/t/issue-with-registering-the-phpextensions-redis/35795/2
09:35:07
@rikudou:lemmings.worldrikudou@lemmings.world
In reply to @jtojnar:matrix.org
replied on https://discourse.nixos.org/t/issue-with-registering-the-phpextensions-redis/35795/2
Note that the latest version of php is not 7.4.4, but 7.4.29: https://history.nix-packages.com/search?packageName=php74
09:36:58
@drupol:matrix.orgPolThe comment still remain.09:37:47
@drupol:matrix.orgPolI would definitely think about upgrading.09:37:54
@jtojnar:matrix.orgJan Tojnarhmm, I used https://lazamar.co.uk/nix-versions/?channel=nixos-unstable&package=php09:38:11
@drupol:matrix.orgPol Jan Tojnar: I already notice that there are missing data from that site 09:38:43
@rikudou:lemmings.worldrikudou@lemmings.world Pol: I'll be taking a look at the flake you've written, I think I get the gist, though it's gonna take more than 5 minutes. Thank you very much! 09:38:48
@drupol:matrix.orgPolI don't use it for that particular reason.09:38:49
@rikudou:lemmings.worldrikudou@lemmings.world
In reply to @jtojnar:matrix.org
hmm, I used https://lazamar.co.uk/nix-versions/?channel=nixos-unstable&package=php
Yeah, it's not updated, that's why I made the https://history.nix-packages.com website
09:39:16
@drupol:matrix.orgPolYou did it well, thank you for that :) now add support for Flake :D09:39:36
@drupol:matrix.orgPolI hope it will get integrated in search.nixos.org at some point09:39:55
@jtojnar:matrix.orgJan Tojnarthanks, updated09:40:10
@rikudou:lemmings.worldrikudou@lemmings.world
In reply to @drupol:matrix.org
I would definitely think about upgrading.
That's true, 7.4 shouldn't be used in production anymore
09:40:30
@rikudou:lemmings.worldrikudou@lemmings.world
In reply to @drupol:matrix.org
I hope it will get integrated in search.nixos.org at some point
Same here, it would be nice.
09:40:52
@jtojnar:matrix.orgJan TojnarI am still wary of exposing it more prominently precisely because it will lead to people using old versions without realizing the issues09:40:57
@drupol:matrix.orgPol
In reply to @jtojnar:matrix.org
I am still wary of exposing it more prominently precisely because it will lead to people using old versions without realizing the issues
Just don't, people needs to be aware of the consequences of using old packages.
09:41:32
@drupol:matrix.orgPol
In reply to @jtojnar:matrix.org
I am still wary of exposing it more prominently precisely because it will lead to people using old versions without realizing the issues
We could display a warning in nix-phps when using an unsupported versions. That could be something easy to implement I guess.
09:42:45
@rikudou:lemmings.worldrikudou@lemmings.world
In reply to @jtojnar:matrix.org
I am still wary of exposing it more prominently precisely because it will lead to people using old versions without realizing the issues
I mean, sometimes you need an old version of whatever software you use. Recently I needed .NET core 3.1, not because I like it, but because a legacy project was stuck there and needed some quick fix. That was actually what prompted the creation of my tool.
09:43:07

Show newer messages


Back to Room ListRoom Version: 6