In PHP versions 7.3.x up to and including 7.3.31, 7.4.x below 7.4.25 and 8.0.x below 8.0.12, when running PHP FPM SAPI with main FPM daemon process running as root and child worker processes running as lower-privileged users, it is possible for the child processes to access memory shared with the main process and write to it, modifying it in a way that would cause the root process to conduct invalid memory reads and writes, which can be used to escalate privileges from local unprivileged user to the root user.
More info: https://lowendtalk.com/discussion/174756/critical-php-fpm-vulnerability
Try to update and upgrade your system components
sudo apt-get update && sudo apt-get upgrade -y
Then check the php version
php -v if the result is 7.4.25 then you're ok.