Skip to content

Instantly share code, notes, and snippets.

@devdrops
Last active September 22, 2017 14:09
Show Gist options
  • Save devdrops/8a497800427ad9b84a4e446e367102ac to your computer and use it in GitHub Desktop.
Save devdrops/8a497800427ad9b84a4e446e367102ac to your computer and use it in GitHub Desktop.
PHPBrew on Ubuntu 14.04

PHPBrew on Ubuntu 14.04

Steps:

  1. Installing

    curl -L -O https://github.com/phpbrew/phpbrew/raw/master/phpbrew
    chmod +x phpbrew
    sudo mv phpbrew /usr/bin/phpbrew
    
  2. Setup

    phpbrew init
    phpbrew known --update
    phpbrew update
    
  3. Lots of PHP dependencies

    sudo apt-get install libxml2-dev
    sudo apt-get install libcurl4-openssl-dev pkg-config
    sudo apt-get install libbz2-dev
    sudo apt-get install libxml2-dev
    sudo apt-get install libreadline-dev
    sudo apt-get install postgresql -y
    
  4. Finally, install a PHP version

    phpbrew -d install 5.4 +default
    
  5. Check if the version is correclty installed.

    phpbrew list
    
  6. Switch to the version you want

    phpbrew switch php-5.4.45 (Or phpbrew switch 5.4.45 in case of Invalid Argument)
    
  7. Check results

    php -v
    
  8. PROFIT!!

OBS You can use variants to add extensions, like below, to add PHP-FPM:

phpbrew -d install 5.4 +default +fpm
@LiamKarlMitchell
Copy link

LiamKarlMitchell commented Jun 23, 2017

Thanks, this also appears to be needed now. Or at least it was for me.

sudo apt-get install libbz2-dev
sudo apt-get install libmcrypt-dev
sudo apt-get install libreadline-dev
sudo apt-get install libpq-dev
sudo apt-get install libxlst-dev

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