# php-fpm [Source](/contrib/php-fpm.php) ## Installing :::caution Do **not** reload php-fpm. Some user requests could fail or not complete in the process of reloading. Instead, configure your server [properly](https://ï.at/avoid-php-fpm-reloading). If you're using Deployer's provision recipe, it's already configured the right way and no php-fpm reload is needed. ::: Add to your _deploy.php_ ```php require 'contrib/php-fpm.php'; ``` ## 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 `echo "" | sudo -S /usr/sbin/service {{php_fpm_service}} reload`. ## 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](https://github.com/deployphp/deployer/blob/master/contrib/php-fpm.php#L40) ### php_fpm_service [Source](https://github.com/deployphp/deployer/blob/master/contrib/php-fpm.php#L49) ```php title="Default value" 'php{{php_fpm_version}}-fpm' ``` ### php_fpm_command [Source](https://github.com/deployphp/deployer/blob/master/contrib/php-fpm.php#L50) ```php title="Default value" 'echo "" | sudo -S /usr/sbin/service {{php_fpm_service}} reload' ``` ## Tasks ### php-fpm:reload [Source](https://github.com/deployphp/deployer/blob/master/contrib/php-fpm.php#L53) Reload the php-fpm service.