This is how I restart PHP-FPM in Debian oriented systems:

/etc/init.d/php7.0-fpm restart

Is there a version agnostic way? All ways I tried from here (besides the one above), failed.


You should be able to use the Bash star(*) wildcard, as referenced in the Bash manpage:

* Matches any string, including the null string. When the globstar shell option is enabled, and * is used in a pathname expansion context, two adjacent *s used as a single pattern will match all files and zero or more directories and subdirectories. If followed by a /, two adjacent *s will match only directories and subdirectories.

In your case:

/etc/init.d/php*-fpm restart

or perhaps

/etc/init.d/php*-fpm* restart

to account for the version number being after the fpm.

  • This doesn't work Usage: /etc/init.d/php-fpm5.6 {start|stop|status|restart|reload|force-reload} – goyote Oct 26 '20 at 6:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.