如何在一台服务器上使用两个不同的PHP版本 [英] How to Use Two Different PHP Versions on One Server
问题描述
我在一台服务器上有2个网站,但是一个网站的PHP版本必须为5.2.17, 另一个必须是5.5 +.
I have 2 websites on a single server, but one site's PHP version must be 5.2.17, and the other must be 5.5+.
我正在将Ubuntu 14.04.2 LTS与Apache2和PHP结合使用.
I am using Ubuntu 14.04.2 LTS with Apache2 and PHP.
我已经安装了PHP 5.5(通过apt-get
)和5.2.17(通过源安装).有人可以告诉我如何为每个指定的网站配置和使用不同的PHP版本吗?谢谢.
I have already installed PHP 5.5 (via apt-get
) and 5.2.17 (via installation from source). Can somebody tell me how to configure and use different PHP versions for each specified website? Thanks.
推荐答案
您可以使用Docker在一台服务器上运行多个PHP版本,请在另一线程中查看我的答案:
You can run multiple PHP versions on one server using Docker, see my answer in another thread: Multiple PHP versions on the same box
请注意,使用此解决方案,可以在不同的端口上使用不同的PHP版本.
Note that with this solution different PHP versions will be available on different ports.
这篇关于如何在一台服务器上使用两个不同的PHP版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!