Skip to content

Instantly share code, notes, and snippets.

@ConnerAiken
Created December 21, 2018 17:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ConnerAiken/c31880762cfd408f200507e9c0298111 to your computer and use it in GitHub Desktop.
Save ConnerAiken/c31880762cfd408f200507e9c0298111 to your computer and use it in GitHub Desktop.
Install multiple versions of PHP in parallel for Ubuntu
#!/bin/bash
# Install common dependency
sudo apt install python-software-properties
# Add Ondřej Surý PPA
sudo add-apt-repository ppa:ondrej/php
# Update apt
sudo apt-get update
# Install apache versions
sudo apt install php5.6 php7.0 php7.1
# Install common extensions
sudo apt install php5.6-cli php5.6-xml php5.6-mysql php7.0-cli php7.0-xml php7.0-mysql php7.1-cli php7.1-xml php7.1-mysql php5.6-curl php7.0-curl php7.1-curl php5.6-mbstring php7.0-mbstring php7.1-mbstring php5.6-zip php7.0-zip php7.1-zip
# Switch between versions
# sudo update-alternatives --set php /usr/bin/php5.6
# sudo update-alternatives --set php /usr/bin/php7.0
# sudo update-alternatives --set php /usr/bin/php7.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment