How to Restart PHP-FPM service and reload config

Last updated on

To restart the PHP-FPM service and reload the configuration file, firstly check which version of PHP you are running:

php -v
PHP 7.0.30-0ubuntu0.16.04.1 (cli) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
 with Zend OPcache v7.0.30-0ubuntu0.16.04.1, Copyright (c) 1999-2017, by Zend Technologies

Above we can see we are running PHP v7.0, therefore the service name should beĀ php7.0-fpm.

To restartĀ the PHP-FPM service, run;

sudo service php7.0-fpm restart

Let me know in the comments if this helped. Follow me @DevAnswers or read more.

1 Star2 Stars3 Stars4 Stars5 Stars 3.67 (3 votes)

Feedback

Your email address will not be published. Required fields are marked *

We use Markdown to style comments, like on Github and Reddit.
To do a line break, type two spaces after the sentence.
You can add inline code by wrapping it in backticks: `code here`

    To do an entire block of code  
    type four spaces before the line
    and it will appear in a block like this.
    <-- four empty spaces

3 replies

Hello

This command is not working here :

[email protected]:/etc/php/7.0/apache2# service php7.0-fpm restart
Failed to restart php7.0-fpm.service: Unit php7.0-fpm.service not found.

Can i help me?

Thank you

[email protected]:/etc/php/7.0/apache2# php -v
PHP 7.0.32-0ubuntu0.16.04.1 (cli) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.32-0ubuntu0.16.04.1, Copyright (c) 1999-2017, by Zend Technologies