Skip to content

Instantly share code, notes, and snippets.

@dserodio
Last active November 29, 2018 15:23
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 dserodio/f50ecbf0d45bcdac549b69d54e0d8153 to your computer and use it in GitHub Desktop.
Save dserodio/f50ecbf0d45bcdac549b69d54e0d8153 to your computer and use it in GitHub Desktop.
Using phpbrew

Install phpbrew

# Download phpbrew
cd ~/.local/bin
curl -L -O https://github.com/phpbrew/phpbrew/raw/master/phpbrew
chmod +x phpbrew

# Install PHP build dependencies
sudo apt install libssl-dev libbz2-dev libcurl4-openssl-dev

# Workaround for php build not finding libcurl header files
cd /usr/local/include
sudo ln -s /usr/include/x86_64-linux-gnu/curl

# Init phpbrew
phpbrew init

Set phpbrew in zsh

cat<<EOT >> ~/.zshrc
function phpbrew() {
    # "lazy-load" this because it's slow
    
    [[ -e ~/.phpbrew/bashrc ]] && source ~/.phpbrew/bashrc
    phpbrew "$@"
}

Install PHP 5.4.45

phpbrew install 5.4.45

Set it as the default

phpbrew use 5.4.45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment