Article directory
Your system cannot find php-fpm.service, there may be the following situations:
1. Check PHP-FPM version
different Linux Distribution and PHP version,php-fpm The service name is different. Check the PHP version first:
php -v
For example, the output is:
PHP 8.1.2 (cli) (built: Jan 23 2022 09:47:36) ( NTS )
Explain that you are using PHP 8.1, then the PHP-FPM service may be php8.1-fpm.
You can view the specific FPM process with the following command:
ps aux | grep php-fpm
If the output is similar to:
root 1234 0.0 0.1 123456 12345 ? Ss 12:34 0:00 php-fpm: master process (/etc/php/8.1/fpm/php-fpm.conf)
Then your service name is php8.3-fpm.
try:
sudo systemctl restart php8.3-fpm
📌 Click the link below to learn how to do it HestiaCP PHP version query tips! 👇👇

2. Find the PHP-FPM service name
If you are unsure of the PHP-FPM service name, you can use:
systemctl list-units --type=service | grep fpm
or:
systemctl | grep php
If it returns:
php7.4-fpm.service loaded active running The PHP 7.4 FastCGI Process Manager
This means your PHP version is 7.4. The correct command should be:
sudo systemctl restart php7.4-fpm
3. Check if PHP-FPM is installed
如果 systemctl Can't find php-fpm, indicating that PHP-FPM may not be installed. You can run:
dpkg -l | grep php
if there is not php-fpm Related packages, install it:
sudo apt update
sudo apt install php-fpm
Then try again:
sudo systemctl restart php-fpm
4. Manually start PHP-FPM
如果 systemctl If the service is still not found, you can start it manually:
sudo /usr/sbin/php-fpm
Then check the progress:
ps aux | grep php-fpm
If PHP-FPM is started but systemctl If the service is still not found, you can create a Systemd configuration file:
sudo nano /etc/systemd/system/php-fpm.service
Add to:
[Unit]
Description=The PHP FastCGI Process Manager
After=network.target
[Service]
ExecStart=/usr/sbin/php-fpm
Restart=always
User=www-data
Group=www-data
[Install]
WantedBy=multi-user.target
then:
sudo systemctl daemon-reload
sudo systemctl enable php-fpm
sudo systemctl start php-fpm
Final Thoughts
- Determine PHP version (
php -v) - Use the correct service name (
php7.4-fpmOrphp8.1-fpmetc) - Check if PHP-FPM is installed (
dpkg -l | grep php) - Manual Start (
/usr/sbin/php-fpm) - If there is no Systemd service, create it manually
You can try these methods and see which one solves your problem! 💡
Hope Chen Weiliang Blog ( https://www.chenweiliang.com/ )'s article "🚨 PHP-FPM restart failed? Fix Unit php-fpm.service not found in 1 minute" may be helpful to you.
Welcome to share the link of this article:https://www.chenweiliang.com/cwl-32493.html
To unlock more hidden tricks🔑, welcome to join our Telegram channel!
If you like it, please share and like it! Your sharing and likes are our continuous motivation!
