Is there a tool to manage multiple PHP installations on the same computer (for example, to support different versions)?

perlbrew is a tool for managing multiple Perl installations on your system, which makes it easy, say, to quickly run a set of test scripts for different versions of Perl.

Is there something similar for PHP? At the moment, when I want to change the version of PHP used by my system, I will go to the build directory for my desired version and run make install .

+7
source share
6 answers

Here is one: http://www.navicopa.com - it allows you to switch between different php versions in one click (just install them in different directories)

And here is free: https://github.com/c9s/phpbrew

Also - you may like this solution as an alternative, if you do not want to use third-party software: https://stackoverflow.com/a/166269/

Also missed that you are using the linux environment, so you really like it: https://github.com/tobiasgies/php-switch

Install all the php versions you need and switch between them using this little bash script.

+4
source

Maybe phpfarm can help you ...

+1
source

When running ./configure add --prefix=/usr/local/php-{version} (replacing {version} with the php version). Then run the script with the specific version:

 /usr/local/php-{version}/bin/PHP .php 

To run in a CGI environment

Make a symbolic link from /usr/local/bin/php-cgi to /usr/local/php-{version}/bin/php-cgi , and then redo the symbolic link and restart the server if you want to switch php versions.

+1
source

It may be a light offtopic, but for local development under the windows, some WAMP stacks provide excellent php version switching with one click. I had a positive experience:

0
source

Not sure if all this is clear to you, but let me know if it is not :)

Kli

For simple cli testing cli you can simply install each version in your own folders, for example. /usr/local/php-5.4/bin , /usr/local/php-5.3.10/bin , etc.

Fastcgi

You can run PHP in FastCGI mode for some time. You can let several versions work at the same time and bind them to different ports, for example. :9000 :9001 :9002 , etc.

The next step is to create several virtual hosts based on the names in Apache, Nginx, Lighttpd or Node.js. Each virtual host associates with a different FastCGI process and therefore uses a different version of PHP.

0
source

This may be too much for what you need, but if you don't mind using Vagrant virtual machines, it can be useful.

0
source

All Articles