PHP: Difference between revisions
link relevant nixpkgs manual section |
m Category:PHP added |
||
(4 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
__TOC__ | __TOC__ | ||
See also [https://nixos.org/manual/nixpkgs/stable/#ssec-php-user-guide PHP User Guide in the nixpkgs manual]. | See also: | ||
* [https://nixos.org/manual/nixpkgs/stable/#ssec-php-user-guide PHP User Guide in the nixpkgs manual]. | |||
* [[phpfpm]] on this wiki | |||
== Install == | == Install == | ||
Line 52: | Line 55: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
You can see the full list of extensions e.g. with: | |||
$ nix repl | |||
nix-repl> pkgs = import <nixpkgs> {} | |||
nix-repl> builtins.attrNames pkgs.phpExtensions | |||
== Apache, plugins, settings == | == Apache, plugins, settings == | ||
Line 211: | Line 221: | ||
}; | }; | ||
}; | }; | ||
</syntaxhighlight> | |||
== Use php Packages with Extensions in a nix-shell == | |||
To use php packages with some extensions enabled, create a <code>shell.nix</code> similar to the following: | |||
<syntaxhighlight lang="nix> | |||
{ pkgs ? import <nixpkgs> { } }: | |||
let | |||
phpEnv = pkgs.php.buildEnv { | |||
extensions = { enabled, all }: enabled ++ (with all; [ xsl ]); | |||
extraConfig = "memory_limit=-1"; | |||
}; | |||
in | |||
pkgs.mkShell { | |||
buildInputs = with pkgs; [ | |||
phpEnv | |||
phpEnv.packages.composer | |||
symfony-cli | |||
]; | |||
} | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 227: | Line 258: | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
[[Category:Languages]] | |||
[[Category:PHP]] |