Skip to content

Instantly share code, notes, and snippets.

@ptaferner
Created August 19, 2015 07:25
Show Gist options
  • Save ptaferner/92c1b4d114d92f5eaef0 to your computer and use it in GitHub Desktop.
Save ptaferner/92c1b4d114d92f5eaef0 to your computer and use it in GitHub Desktop.
Installing and using multiple php versions on Debian 8.

phpfarm is a useful set of scripts which makes the installation and usage of multiple PHP versions easy and convenient. Basically, the instructions below follow the installation guidelines from the official git repository: https://github.com/cweiske/phpfarm.

  • Install necessary packages for build process.
sudo apt-get install build-essential libxml2 libxml2-dev libssl-dev 
libcurl4-openssl-dev pkg-config libcurl4-gnutls-dev libjpeg-dev 
libpng12-dev libmysqlclient-dev
  • Clone phpfarm repository into local directory (another FHS-compliant install location would be /opt).
git clone git://git.code.sf.net/p/phpfarm/code phpfarm
cd phpfarm/src
  • (Optional) Configure compile options.
sudo vim custom-options-5.3.29.sh
  • Compile php and verify it.
sudo ./compile.sh 5.3.29
~/phpfarm/inst/bin/php-5.3.29 --version
  • (Optional) Switching versions can be done with switch-phpfarm (see phpfarm repository for details).
$ switch-phpfarm
Switch the currently active PHP version of phpfarm
Available versions:
 5.3.29
 5.4.6
$ switch-phpfarm 5.4.6

Note: inst/current-bin must be part of $PATH for this.

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