php有一个等价于python的virtualenv或ruby的沙盒?
我习惯于使用python的virtualenv工具创建单独的环境,可以模拟我写的项目的部署环境。
I'm used to using python's virtualenv tool to create separate environments that can mimic deployment environments for projects I write.
现在,我要工作在php项目,我想知道是否有任何等价的?具体来说,我希望能够在一个(较旧的)php版本的apache上运行一个虚拟主机,而其他的都运行在正常的最新版本。
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.
我的开发机器运行ubuntu 11.04,所以在该平台上工作的解决方案将是首选。
My development machine is running ubuntu 11.04, so solutions that work on that platform would be preferred.
假设你使用mod_php ,没有办法将多个不同的版本加载到同一个Apache实例中。你可以运行多个不同的版本,如果你运行PHP作为CGI或FastCGI,但这本身会引入一些行为与mod_php的差异。
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.