Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an easy way to switch PHP versions while developing?

Tags:

php

I love rvm (ruby version manager), it allows to switch quickly between Ruby versions on the command line, like this:

$ rvm use 1.9.3

Is there a similiar tool for PHP? (Preferably on the command line.) I'm currently developing a PHP framework, so I quickly need to test the code on different PHP version.

I'm using Ubuntu 11.10.

like image 808
js-coder Avatar asked May 15 '12 19:05

js-coder


1 Answers

You can simply install different versions on PHP, each in a different directory, then use the one you want. You can even make a simple script to automate this (it would run the PHP executable from the directory corresponding to an argument, and/or it could change the Apache configuration to use the specified version and reload Apache).

like image 115
rid Avatar answered Oct 02 '22 19:10

rid