PHP-FPM (FastCGI Process Manager) handles PHP requests on AvaHost’s high-performance VPS, powering dynamic websites like WordPress or custom applications. Restarting PHP-FPM is necessary after configuration changes, PHP upgrades, or to troubleshoot issues like 502 errors. This guide provides simple methods to restart PHP-FPM on AvaHost’s Ubuntu or CentOS VPS, leveraging NVMe SSDs and LiteSpeed compatibility for optimal performance.
AvaHost Linux VPS (e.g., VPS Basic, €10/month) with Ubuntu or CentOS.
Root or sudo access (ssh root@your-vps-ip).
PHP-FPM installed (default with AvaHost’s LAMP stack or cPanel).
Knowledge of your PHP version (e.g., 7.4, 8.1) via:
php -v
Most modern Linux distributions, including Ubuntu, Debian, CentOS, and RHEL, use systemd to manage services. Use the following command:
sudo systemctl restart php-fpm
For specific PHP versions (e.g., PHP 7.4 or PHP 8.1), specify the version:
sudo systemctl restart php7.4-fpm
sudo systemctl restart php8.1-fpm
To check the status of PHP-FPM:
sudo systemctl status php-fpm
Some older Linux distributions use the service command instead of systemctl:
sudo service php-fpm restart
For specific PHP versions:
sudo service php7.4-fpm restart
sudo service php8.1-fpm restart
On legacy systems that still rely on SysVinit, restart PHP-FPM with:
sudo /etc/init.d/php-fpm restart
For a specific PHP version:
sudo /etc/init.d/php7.4-fpm restart
Instead of a full restart, you can reload PHP-FPM to apply changes without terminating existing connections:
sudo systemctl reload php-fpm
For specific PHP versions:
sudo systemctl reload php7.4-fpm
If a restart command doesn’t work, manually stopping and starting PHP-FPM can help:
sudo systemctl stop php-fpm
sudo systemctl start php-fpm
If PHP-FPM is unresponsive, manually kill all processes and restart:
sudo pkill -9 php-fpm
sudo systemctl start php-fpm
Restarting PHP-FPM on AvaHost’s VPS is straightforward using systemctl, service, or manual methods, ensuring smooth operation for PHP-based applications like WordPress or custom CMS. AvaHost’s NVMe SSDs, LiteSpeed integration, and cPanel tools enhance performance and simplify management.