Update Ubuntu sudo apt update && sudo apt upgrade Install Required Packages sudo apt install software-properties-common apt-transport-https -y Import Ondřej Surý PHP Repository sudo add-apt-repository ppa:ondrej/php -y sudo apt update sudo apt upgrade Install PHP 7.4 with Apache Option sudo apt install php7.4 php7.4-common libapache2-mod-php7.4 php7.4-cli restart your Apache server to load the new PHP module. sudo systemctl restart apache2 Or restart NGinx server if you are running. sudo systemctl restart nginx Install PHP7.4-FPM and Other Extensions sudo apt-get install php7.4-fpm php7.4-cli php7.4-mysql php7.4-curl php7.4-json -y start the PHP7.4-FPM service and enable it to start at system reboot: sudo systemctl start php7.4-fpm sudo systemctl enable php7.4-fpm Restart Nginx systemctl restart nginx