I tried to remove PHP 7.4 on Laravel Forge servers, which is installed and not a default as I chose PHP 8, but then got the warning:
The domain.com site is actively using this version of PHP. Please remove the site or change its PHP version before uninstalling PHP 7.4.
Main Server
And yes, I do see PHP 7.4 run by root
forge@site-w-2:~/site.com/current$ ps aux |grep php/7.4
root 1081318 0.0 0.3 100204 29752 ? Ss Nov03 0:32 php-fpm: master process (/etc/php/7.4/fpm/php-fpm.conf)
forge 1259014 0.0 0.0 8160 2400 pts/0 S+ 00:28 0:00 grep --color=auto php/7.4
but all main processes are using PHP 8.0:
forge@site-prod-w-2:~/site.com/current$ ps aux |grep php
root 704481 0.0 0.3 246592 24820 ? Ss Oct23 1:35 php-fpm: master process (/etc/php/8.0/fpm/php-fpm.conf)
forge 704482 0.0 0.1 247032 11248 ? S Oct23 0:00 php-fpm: pool www
forge 704483 0.0 0.1 247032 11248 ? S Oct23 0:00 php-fpm: pool www
root 1081318 0.0 0.3 100204 29752 ? Ss Nov03 0:32 php-fpm: master process (/etc/php/7.4/fpm/php-fpm.conf)
forge 1245115 0.1 0.8 140040 65292 ? S Nov08 0:41 php8.0 artisan horizon
forge 1245124 0.0 0.7 137992 64800 ? S Nov08 0:41 /usr/bin/php8.0 artisan horizon:supervisor site-prod-w-2-2ubE:supervisor-1 redis --workers-name=default --balance=auto --max-processes=10 --min-processes=1 --nice=0 --balance-cooldown=3 --balance-max-shift=1 --parent-id=1245115 --backoff=0 --max-time=0 --max-jobs=0 --memory=128 --queue=default,ssl-manager --sleep=3 --timeout=300 --tries=3 --rest=0
forge 1245141 0.0 0.8 140044 65372 ? S Nov08 0:13 /usr/bin/php8.0 artisan horizon:work redis --name=default --supervisor=site-prod-w-2-2ubE:supervisor-1 --backoff=0 --max-time=0 --max-jobs=0 --memory=128 --queue=ssl-manager --sleep=3 --timeout=300 --tries=3 --rest=0
forge 1245219 0.0 0.9 225600 79672 ? S Nov08 0:13 /usr/bin/php8.0 artisan horizon:work redis --name=default --supervisor=site-prod-w-2-2ubE:supervisor-1 --backoff=0 --max-time=0 --max-jobs=0 --memory=128 --queue=default --sleep=3 --timeout=300 --tries=3 --rest=0
forge 1246326 6.9 0.5 196980 44616 ? S Nov08 46:49 php-fpm: pool www
forge 1246330 6.9 0.5 196980 44464 ? S Nov08 46:50 php-fpm: pool www
forge 1255181 5.8 0.5 123212 43808 ? S Nov08 12:31 php-fpm: pool www
forge 1259266 0.0 0.0 8156 2576 pts/0 S+ 00:36 0:00 grep --color=auto php
Staging
For our staging server (older DigitalOcean Ubuntu Droplet) I even seem to have PHP 7.2 running which is not installed according to Forge…
forge@site-staging:~/staging.site.com/current$ ps aux |grep php/7.2
root 9854 0.0 0.2 502220 4644 ? Ss Nov03 0:21 php-fpm: master process (/etc/php/7.2/fpm/php-fpm.conf)
forge 12822 0.0 0.0 14860 1004 pts/0 S+ 00:29 0:00 grep --color=auto php/7.2
PHP 7.4 is there too, but not by default.
forge@site-staging:~/staging.site.com/current$ ps aux |grep php/7.4
root 9652 0.0 0.3 505052 7916 ? Ss Nov03 0:21 php-fpm: master process (/etc/php/7.4/fpm/php-fpm.conf)
forge 12833 0.0 0.1 14860 2644 pts/0 S+ 00:29 0:00 grep --color=auto php/7.4
Solutions
Do I need to do:
sudo apt-get purge php7.*
sudo apt-get autoclean
sudo apt-get autoremove
bypassing the Forge Dashboard options as they do not work and get rid of PHP 7? Or should I kill the processes running? How can PHP 7.4 and 7.2 still be used if PHP 8 is the default?