How to restart php-fpm after deployment

Hi there! :wave:

I’m working on enabling PHP Opcache extension. To have this working correctly, PHP-FPM needs to be restarted after each deployment. My problem is that I cannot create a working webhook to do this. All problems seem to relate to the deployment user having insufficient privileges.

I have tried stuff like “service php-fpm restart” and “systemctl restart php8.2-fpm.service”. These fail because interactive authentication is needed. Switching to “sudo …” does not really help.

Do you have a solution to do this properly?

Cheers,

Barry

Hi Barry,
php-fpm reload should automatically happen at “Active” step for both php or Laravel site types as long as Restart Service After Deployment option is on (see screenshot below; should be on by default). Can you provide us few more details to help you better?

  1. What kind of site is this?
  2. What version of php?
  3. Did you install php yourself manually or through Cleavr UI?

Hi Ashok,

That is exactly what I was looking for! Didn’t know this feature existed. (I have a Laravel site with PHP 8.2 installed through Cleavr, so this should work already).

Thanks a lot!

Barry

1 Like