PHP

From NixOS Wiki
Revision as of 20:12, 13 March 2022 by imported>Jasoncarr0 (Add some explanation to make more user friendly)

Install

  environment.systemPackages = with pkgs; [ php ];

See nix search php (nix search nixpkgs php with [flakes](https://nixos.wiki/wiki/Flakes) enabled) for additional versions like php74, etc.

Setting custom php.ini configurations

The `buildEnv` attribute on php can add extra configuration options. For instance, to set a memory_limit in the NixOS configuration.nix:

environment.systemPackages =
  let
    php = pkgs.php.buildEnv { extraConfig = "memory_limit = 2G"; };
  in [
    php
  ];