Skip to content

Instantly share code, notes, and snippets.

@PontusTideman
Forked from frankIT/switchphpto
Created July 6, 2020 11:25
Show Gist options
  • Save PontusTideman/8eed85878e7a50e83477782298854545 to your computer and use it in GitHub Desktop.
Save PontusTideman/8eed85878e7a50e83477782298854545 to your computer and use it in GitHub Desktop.
coexistence of multiple php versions on debian stretch
#!/bin/bash
# references:
# https://tecadmin.net/switch-between-multiple-php-version-on-debian/
# https://pehapkari.cz/blog/2017/03/27/multiple-php-versions-the-easy-way/
# https://github.com/leymannx/apache-multiphp
# https://deb.sury.org/
VERSION=$1
# unmount all php apache modules
sudo a2dismod php5.6 php7.0 php7.2 php7.3
# mount the needed apache php module
sudo a2enmod php"$VERSION"
# restart apache
sudo service apache2 restart
# fix system symlinks
sudo update-alternatives --config php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment