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

Zxaos picture Zxaos · Aug 24, 2011 · Viewed 15.8k times · Source

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.

Answer

duskwuff -inactive- picture duskwuff -inactive- · Sep 28, 2011

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.