Skip to content
logo
All snippets
Published on

Switch Between Multiple PHP Versions on Linux

How to switch between multiple php versions using the command line on Linux

  • php

How to switch between multiple php versions using the command line on Ubuntu/Linux.

Before getting started, make sure you have:

  • A running Ubuntu/Linux system (or any of its derivatives)
  • Multiple PHP versions already installed on your system

We can use the following command:

bash
sudo update-alternatives --config php
Share

More snippets