如何在一台服务器上使用两个不同的 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 版本,请参阅我在另一个线程中的回答:同一个盒子上有多个 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屋!