Back to Deployer

Php-fpm Recipe

docs/contrib/php-fpm.md

8.0.32.8 KB
Original Source
<!-- DO NOT EDIT THIS FILE! --> <!-- Instead edit contrib/php-fpm.php --> <!-- Then run bin/docgen -->

Php-fpm Recipe

php
require 'contrib/php-fpm.php';

Source

:::caution Do not reload php-fpm. Some user requests could fail or not complete in the process of reloading. Instead, configure your server properly. If you're using Deployer's provision recipe, it's already configured the right way and no php-fpm reload is needed. :::

Configuration

  • php_fpm_version – The PHP-fpm version. For example: 8.0.
  • php_fpm_service – The full name of the PHP-fpm service. Defaults to php{{php_fpm_version}}-fpm.
  • php_fpm_command – The command to run to reload PHP-fpm. Defaults to sudo systemctl reload {{php_fpm_service}}.

Usage

Start by explicitely providing the current version of PHP-version using the php_fpm_version. Alternatively, you may use any of the options above to configure how PHP-fpm should reload. Then, add the php-fpm:reload task at the end of your deployments by using the after method like so.

php
set('php_fpm_version', '8.0');
after('deploy', 'php-fpm:reload');

Configuration

php_fpm_version

Source

:::caution Do not reload php-fpm. Some user requests could fail or not complete in the process of reloading. Instead, configure your server properly. If you're using Deployer's provision recipe, it's already configured the right way and no php-fpm reload is needed. :::

Configuration

  • php_fpm_version – The PHP-fpm version. For example: 8.0.
  • php_fpm_service – The full name of the PHP-fpm service. Defaults to php[php_fpm_version](/docs/contrib/php-fpm.md#php_fpm_version)-fpm.
  • php_fpm_command – The command to run to reload PHP-fpm. Defaults to sudo systemctl reload [php_fpm_service](/docs/contrib/php-fpm.md#php_fpm_service).

Usage

Start by explicitely providing the current version of PHP-version using the php_fpm_version. Alternatively, you may use any of the options above to configure how PHP-fpm should reload. Then, add the php-fpm:reload task at the end of your deployments by using the after method like so.

php
set('php_fpm_version', '8.0');
after('deploy', 'php-fpm:reload');

Automatically detects by using bin/php.

php
return run('{{bin/php}} -r "printf(\'%d.%d\', PHP_MAJOR_VERSION, PHP_MINOR_VERSION);"');

php_fpm_service

Source

php
'php{{php_fpm_version}}-fpm'

Tasks

php-fpm:reload {#php-fpm-reload}

Source

Reloads the php-fpm service.