Skip to content

Instantly share code, notes, and snippets.

@timoffmax
Created November 22, 2018 11:03
Show Gist options
  • Save timoffmax/4079c142fbfbfbae4bb4588c6fc126ee to your computer and use it in GitHub Desktop.
Save timoffmax/4079c142fbfbfbae4bb4588c6fc126ee to your computer and use it in GitHub Desktop.

Revisions

  1. timoffmax created this gist Nov 22, 2018.
    11 changes: 11 additions & 0 deletions php_switch_console_version.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    #!/bin/bash

    ### Using ###
    # chmod +x php_switch_console_version.sh
    # sudo ./php_switch_console_version.sh 7.3

    update-alternatives --set php /usr/bin/php$1
    update-alternatives --set phar /usr/bin/phar$1
    update-alternatives --set phar.phar /usr/bin/phar.phar$1
    update-alternatives --set phpize /usr/bin/phpize$1
    update-alternatives --set php-config /usr/bin/php-config$1