How to Restart PHP-FPM Service and Reload Config

Last updated on | 4 replies

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

php -v
PHP 7.2.15-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Feb  8 2019 15:38:01) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.15-1+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies

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

To restart the PHP-FPM service, run;

sudo service php7.2-fpm restart

Let me know if this helped. Follow me on Twitter, Facebook and YouTube, or 🍊 buy me a smoothie.

p.s. I increased my AdSense revenue by 200% using AI 🤖. Read my Ezoic review to find out how.

4 replies

Leave a reply

Your email address will not be published.

  1. Hello

    This command is not working here :

    root@vestacp:/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

    1. root@vestacp:/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

        1. sudo apt-get install php-fpm libapache2-mod-php php-mysql php-curl php-xml
          Reading package lists… Done
          Building dependency tree
          Reading state information… Done
          libapache2-mod-php is already the newest version (1:7.0+49).
          php-curl is already the newest version (1:7.0+49).
          php-fpm is already the newest version (1:7.0+49).
          php-mysql is already the newest version (1:7.0+49).
          php-xml is already the newest version (1:7.0+49).
          0 upgraded, 0 newly installed, 0 to remove and 376 not upgraded.
          Failed to restart php7.2-fpm.service: Unit php7.2-fpm.service not found.
          pluto{lyon}199: cd /etc
          pluto{lyon}200: cd php
          pluto{lyon}201: ls
          7.0/
          php -v
          PHP 7.0.33-0+deb9u10 (cli) (built: Oct 6 2020 17:08:28) ( NTS )
          Yes indeed, this is the correct php version.

          What am I doing wrong? I must be doing something dumb.