Report this

What is the reason for this report?

How to restart php on LAMP marketplace image?

Posted on October 8, 2021

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:

  1. 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:

  1. 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.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.