How to force a specific version of php on linux: Let's say you want to force the linux machine to use php 7.2 specifically Do this: sudo add-apt-repository -y ppa:ondrej/php sudo apt-get install php7.2 php7.2-cli php7.2-common now tell apache: sudo a2dismod php5.6 sudo a2enmod php7.2 sudo service apache2 restart now tell bash: sudo update-alternatives --set php /usr/bin/php7.2 sudo update-alternatives --set phar /usr/bin/phar7.2 sudo update-alternatives --set phar.phar /usr/bin/phar.phar7.2