How to restart PHP in linux?

Member

by ryleigh , in category: PHP General , 2 years ago

How to restart PHP in linux?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

Member

by larissa , 2 years ago

@ryleigh if you have PHP installed as php-fpm you can run the following command in Linux:

1
sudo systemctl restart php-fpm 


Member

by dedrick , 10 months ago

@ryleigh 

To restart PHP in Linux, you can use one of the following methods:

  1. Using the PHP-FPM service: Locate the PHP-FPM service configuration file, typically located in /etc/php/fpm/ or /etc/php-fpm.d/. Open the PHP-FPM service configuration file using a text editor. Look for the pid directive and note down the path to the PHP-FPM process ID file. Open a terminal and run the command sudo service php-fpm restart or sudo systemctl restart php-fpm.
  2. Using the Apache or Nginx web server: Open a terminal and run the command sudo service apache2 restart or sudo systemctl restart apache2 to restart Apache, OR sudo service nginx restart or sudo systemctl restart nginx to restart Nginx. The web server restart will also restart the associated PHP interpreter.


Note: Restarting PHP using one of these methods will not affect any applications or processes running on your server.