Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
'.bash_aliases' - DEV - Change PHP Version
# Aliases - PHP
alias php.info='php -i'
alias php5.6='sudo a2dismod php7.0 && sudo a2dismod php7.1 && sudo a2dismod php7.2 && sudo a2dismod php7.3 && sudo a2dismod php7.4 && sudo a2enmod php5.6 && sudo update-alternatives --set php /usr/bin/php5.6 && sudo service apache2 restart'
alias php7.0='sudo a2dismod php5.6 && sudo a2dismod php7.1 && sudo a2dismod php7.2 && sudo a2dismod php7.3 && sudo a2dismod php7.4 && sudo a2enmod php7.0 && sudo update-alternatives --set php /usr/bin/php7.0 && sudo service apache2 restart'
alias php7.1='sudo a2dismod php5.6 && sudo a2dismod php7.0 && sudo a2dismod php7.2 && sudo a2dismod php7.3 && sudo a2dismod php7.4 && sudo a2enmod php7.1 && sudo update-alternatives --set php /usr/bin/php7.1 && sudo service apache2 restart'
alias php7.2='sudo a2dismod php5.6 && sudo a2dismod php7.0 && sudo a2dismod php7.1 && sudo a2dismod php7.3 && sudo a2dismod php7.4 && sudo a2enmod php7.2 && sudo update-alternatives --set php /usr/bin/php7.2 && sudo service apache2 restart'
alias php7.3='sudo a2dismod php5.6 && sudo a2dismod php7.0 && sudo a2dismod php7.1 && sudo a2dismod php7.2 && sudo a2dismod php7.4 && sudo a2enmod php7.3 && sudo update-alternatives --set php /usr/bin/php7.3 && sudo service apache2 restart'
alias php7.4='sudo a2dismod php5.6 && sudo a2dismod php7.0 && sudo a2dismod php7.1 && sudo a2dismod php7.2 && sudo a2dismod php7.3 && sudo a2enmod php7.4 && sudo update-alternatives --set php /usr/bin/php7.4 && sudo service apache2 restart'
@laxmi-narayan-nitdgp
Copy link

laxmi-narayan-nitdgp commented Jun 22, 2018

if i want to enable some different mpm other than mpm_prefork with php5.6 , is that possible or not ?

Loading

@djravine
Copy link
Author

djravine commented Jan 15, 2019

This is from a stack overflow: https://stackoverflow.com/a/42642275/5416320

@Laxmi - I don't think it is compatible with any other MPM's

Loading

@djravine
Copy link
Author

djravine commented Jan 15, 2019

Updated for PHP7.3

Loading

@djravine
Copy link
Author

djravine commented Aug 7, 2019

Updated for PHP7.4

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment