for Ubuntu use this command
wget https://raw.githubusercontent.com/ahmedash95/php-installer/master/ubuntu.sh && sudo sh ubuntu.sh
for Fedora use this command
wget https://raw.githubusercontent.com/ahmedash95/php-installer/master/fedora.sh && sudo sh fedora.sh