Skip to content

php

Whether to enable tools for PHP development.

Type: boolean

Default:

false

Example:

true

Declared by:

Allows you to override the default used package to adjust the settings or add more extensions. You can find the extensions using devenv search 'php extensions'

Type: package

Default:

pkgs.php

Example:

pkgs.php.buildEnv {
extensions = { all, enabled }: with all; enabled ++ [ xdebug ];
extraConfig = ''
memory_limit=1G
'';
};

Declared by:

Attribute set of packages including composer

Type: submodule

Default:

pkgs

Declared by:

composer package

Type: null or package

Default:

pkgs.phpPackages.composer

Declared by:

PHP extensions to disable.

Type: list of string

Default:

[ ]

Declared by:

PHP extensions to enable.

Type: list of string

Default:

[ ]

Declared by:

Extra configuration that should be put in the global section of the PHP-FPM configuration file. Do not specify the options error_log or daemonize here, since they are generated by NixOS.

Type: null or strings concatenated with “\n”

Default:

null

Declared by:

Options appended to the PHP configuration file php.ini.

Type: strings concatenated with “\n”

Default:

""

Example:

''
date.timezone = "CET"
''

Declared by:

PHP-FPM pools. If no pools are defined, the PHP-FPM service is disabled.

Type: attribute set of (submodule)

Default:

{ }

Example:

{
mypool = {
user = "php";
group = "php";
phpPackage = pkgs.php;
settings = {
"pm" = "dynamic";
"pm.max_children" = 75;
"pm.start_servers" = 10;
"pm.min_spare_servers" = 5;
"pm.max_spare_servers" = 20;
"pm.max_requests" = 500;
};
}
}

Declared by:

languages.php.fpm.pools.<name>.extraConfig

Section titled “languages.php.fpm.pools.<name>.extraConfig”

Extra lines that go into the pool configuration. See the documentation on php-fpm.conf for details on configuration directives.

Type: null or strings concatenated with “\n”

Default:

null

Declared by:

The address on which to accept FastCGI requests.

Type: string

Default:

""

Example:

"/path/to/unix/socket"

Declared by:

Environment variables used for this PHP-FPM pool.

Type: attribute set of string

Default:

{ }

Example:

{
HOSTNAME = "$HOSTNAME";
TMP = "/tmp";
TMPDIR = "/tmp";
TEMP = "/tmp";
}

Declared by:

Options appended to the PHP configuration file php.ini used for this PHP-FPM pool.

Type: strings concatenated with “\n”

Declared by:

The PHP package to use for running this PHP-FPM pool.

Type: package

Default:

phpfpm.phpPackage

Declared by:

PHP-FPM pool directives. Refer to the “List of pool directives” section of https://www.php.net/manual/en/install.fpm.configuration.php“ the manual for details. Note that settings names must be enclosed in quotes (e.g. "pm.max_children" instead of pm.max_children).

Type: attribute set of (string or signed integer or boolean)

Default:

{ }

Example:

{
"pm" = "dynamic";
"pm.max_children" = 75;
"pm.start_servers" = 10;
"pm.min_spare_servers" = 5;
"pm.max_spare_servers" = 20;
"pm.max_requests" = 500;
}

Declared by:

Path to the Unix socket file on which to accept FastCGI requests.

This option is read-only and managed by NixOS.

Type: string (read only)

Example:

config.env.DEVENV_STATE + "/php-fpm/<name>.sock"

Declared by:

PHP-FPM global directives.

Refer to the “List of global php-fpm.conf directives” section of https://www.php.net/manual/en/install.fpm.configuration.php for details.

Note that settings names must be enclosed in quotes (e.g. "pm.max_children" instead of pm.max_children).

You need not specify the options error_log or daemonize here, since they are already set.

Type: attribute set of (string or signed integer or boolean)

Default:

{
error_log = config.env.DEVENV_STATE + "/php-fpm/php-fpm.log";
}

Declared by:

PHP.ini directives. Refer to the “List of php.ini directives” of PHP’s

Type: null or strings concatenated with “\n”

Default:

""

Declared by:

Whether to enable PHP Language Server.

Type: boolean

Default:

true

Example:

true

Declared by:

The PHP language server package to use.

Type: package

Default:

pkgs.phpactor

Declared by:

The PHP version to use.

Type: string

Default:

""

Declared by: