Hi,
I tried to restart php with service, systemctl or init.d/ but I unable to restart php and it says “Unit php8.0-fpm.service could not be found.”
php -v PHP 8.0.11 (cli) (built: Sep 23 2021 21:26:24) ( NTS ) Copyright © The PHP Group Zend Engine v4.0.11, Copyright © Zend Technologies with Zend OPcache v8.0.11, Copyright ©, by Zend Technologies
How can I restart php?
Regards,
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
First, let’s find the service name:
systemctl list-units|grep php
If a service named php comes back, restart it
If nothing comes back, that means we need to find out the web server you’re running:
systemctl list-units|grep 'nginx\|apache' # leave the \ in there
If it comes back apache, restart apache. If it comes back NGINX, let me know here, and I can help further.
Hello, @mraheel83Starfish
You can first check if the php-fpm service is running using the ps command:
- ps axu | grep -i php
The output will help you to see which is the php-fpm process and from there you can restart the php-fpm service using the systemctl command:
- systemctl restart php8.0-fpm.service
Note that your version might be different and you’ll need to substitute 8.0 with the actual php-fpm version that your server runs.
Regards, Alex
This might sound silly, but where do I enter this command? When I launch Console, it always starts with the initial WP one-click install prompt.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.
