sudo apt install libapache2-mod-php$x sudo a2enmod php$x sudo service apache2 restart # change $x to your prefered php installed version