Run Multiple Versions of PHP at Once with phpfarm

As languages evolve and functionality changes with each new release, it’s important to understand how those changes affect what you’re working on. Such as true with PHP, and for those projects written in PHP, wouldn’t it be great to know if things are going to break or return strange errors depending on what version of PHP the end user is running?

 

Enter phpfarm! With this tool, you can do just that. I had the distinct pleasure of speaking with lead developer Christian Weiske about how phpfarm works, and its recent move to SourceForge.

How did the project get started?

It all started with me getting into the QA initiative in PEAR, and the dedicated testing server that got sponsored.

Developers run their packages’ tests on their own development machine, and sometimes on the machines that host the applications the package has been written for. That’s two PHP versions at most.

 

To assure that the PEAR packages run with many - from the latest to the oldest - versions of PHP, especially the ones the developers do not have themselves, the PEAR project needed to provide an integration server that has many versions of PHP available. The other alternative, many servers with one PHP version each, was not possible for us since we only have one testing server.

 

Because no single linux distribution provides a way to install multiple PHP versions beside each other, we needed to roll our own tool.

 

Compiling PHP from source is not hard, but compiling several versions is tedious. Also, when upgrading the system’s libraries, you sometimes need to recompile your PHP to fix now broken dependencies.

 

The task was to be able to compile a version of PHP with a single command. Downloading the sources, configuring with the correct flags, setting the correct php.ini options and installing it in a way they do not influence each other are the things phpfarm should do.

 

After phpfarm worked, I began to use it on the development servers at work and suddenly needed a way to get the web server working with those different PHP installations at once. So I found out how to use FastCGI correctly, documented it in my blog and phpfarm compiles CGI binaries by default now.

 

What have you learned along the way that would help other open source admins?

At first phpfarm was hosted on svn.php.net - without anything else. No homepage, no ticket system.

This was a problem because nobody could report bugs, download it without having to install svn or contribute patches easily.

With the switch to SourceForge (which I would not have done if the new interface wouldn’t have been there yet btw) I got all of them, and by moving to git, people can more easily fork phpfarm and contribute patches.

What is the future of phpfarm?

Slow evolution I think. Fix the few bugs and ideas I have for it, and I’ll probably also make phpfarm do the Apache CGI setup automatically.

 

I don’t have big plans since phpfarm already does what it is made for.

Why do you personally contribute to open source?

Because open source software is the only sustainable way to write and use software.

I stay away from closed source and cloud services wherever possible, because tomorrow, when my internet connection is down or the company who built the application went bankrupt, the base of my digital life is broken.

Open Source is always there. I can host it myself. I can fix it myself - and if I don’t happen to speak the language the app is written in, I can find people everywhere who can fix it.

 

This is also the reason for me to contribute to SemanticScuttle, a self-hosted social bookmark manager. If you use it, you don’t have to fear Delicious getting sold again and finally going down.

How can people help you? What are your main needs right now?

phpfarm is fine now and does not need much maintenance. The usual “rules” for open source applications apply:
If you find bugs, report them.
If you have requests, report them.
If you can fix them yourself, fork the git repo and notify me so I can integrate your changes in the official release.

If you really have some spare time left and know PHP, help out with SemanticScuttle to make the cool features like federation (communication between different installations on different servers) reality.

Thanks, Christian!

To download a copy of phpfarm, or read more about it: http://sourceforge.net/projects/phpfarm/
To download a copy of SemanticScuttle, or read more about it:http://sourceforge.net/projects/semanticscuttle/

Views: 97

Comment

You need to be a member of Zomi Community Network - Your Network to add comments!

Join Zomi Community Network - Your Network

© 2024   Created by Zomi Community Network.   Powered by

Badges  |  Report an Issue  |  Terms of Service