Skip to content

Instantly share code, notes, and snippets.

@christopher-hopper
Last active May 16, 2023 11:02
Show Gist options
  • Select an option

  • Save christopher-hopper/d3467ab87217dc1143f832ba7012c0f7 to your computer and use it in GitHub Desktop.

Select an option

Save christopher-hopper/d3467ab87217dc1143f832ba7012c0f7 to your computer and use it in GitHub Desktop.

Revisions

  1. christopher-hopper revised this gist Jan 8, 2018. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions phpenv-ubuntu-xenial.sh
    Original file line number Diff line number Diff line change
    @@ -7,6 +7,8 @@ if [[ ! "${OSTYPE}" =~ "^linux" ]] || [[ ! "$(lsb_release -c 2>/dev/null)" =~ "x
    exit 1;
    fi

    sudo apt-get update

    # Build dependencies.
    sudo apt-get install -y build-essential git-core curl wget
    sudo apt-get -y build-dep php-cli
  2. christopher-hopper revised this gist Jan 8, 2018. 1 changed file with 18 additions and 0 deletions.
    18 changes: 18 additions & 0 deletions phpenv-ubuntu-xenial.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,11 @@
    #!/usr/bin/env bash
    # vim: ai ts=2 sw=2 et sts=2 ft=sh

    # Check OS.
    if [[ ! "${OSTYPE}" =~ "^linux" ]] || [[ ! "$(lsb_release -c 2>/dev/null)" =~ "xenial" ]]; then
    (>&2 echo "Error: This script is for Ubuntu 16.04 LTS (xenial) not '${OSTYPE}'.")
    exit 1;
    fi

    # Build dependencies.
    sudo apt-get install -y build-essential git-core curl wget
    @@ -11,8 +18,19 @@ curl -L http://git.io/phpenv-installer | bash
    # List available PHP builds to install.
    phpenv install --list

    # Install php70
    phpenv install 7.0.27

    # Install php71
    phpenv install 7.1.13

    # Install php72
    phpenv install 7.2.1

    for PHP_PATH in $HOME/.phpenv/versions/[0-9].[0-9].[0-9]*; do
    PHP_VERSION=${PHP_PATH##*/};
    unlink "${HOME}/.phpenv/versions/${PHP_VERSION%.*}" 2>/dev/null
    ln -s "${PHP_PATH}" "${HOME}/.phpenv/versions/${PHP_VERSION%.*}" 2>/dev/null
    done

    phpenv rehash
  3. christopher-hopper created this gist Jan 8, 2018.
    18 changes: 18 additions & 0 deletions phpenv-ubuntu-xenial.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    #!/usr/bin/env bash

    # Build dependencies.
    sudo apt-get install -y build-essential git-core curl wget
    sudo apt-get -y build-dep php-cli
    sudo apt-get install -y libcurl4-openssl-dev libmcrypt-dev libreadline-dev libxslt1-dev libxml2-dev

    # Installer for phpenv.
    curl -L http://git.io/phpenv-installer | bash

    # List available PHP builds to install.
    phpenv install --list

    # Install php71
    phpenv install 7.1.13

    # Install php72
    phpenv install 7.2.1