Does php have an equivalent to python's virtualenv or ruby's sandbox?

I'm used to using python's virtualenv tool to create separate environments that can mimic deployment environments for projects I write.

Now, I'm going to be working on a php project and I'm wondering if there's any equivalent to that? Specifically I'm hoping to be able to run one virtualhost on apache with one (older) version of php, while everything else runs on the normal up to date version.

My development machine is running ubuntu 11.04, so solutions that work on that platform would be preferred.


Assuming that you are using mod_php, there is no way to load multiple different versions into the same Apache instance. You can run multiple different versions if you're running PHP as CGI or FastCGI, but this will itself introduce some differences in behavior from mod_php.


Another alternative to virtual machines is docker.