简体   繁体   English

如何在一台服务器上使用两个不同的PHP版本

[英]How to Use Two Different PHP Versions on One Server

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+. 我在一台服务器上有2个网站,但是一个网站的PHP版本必须为5.2.17,另一个必须为5.5+。

I am using Ubuntu 14.04.2 LTS with Apache2 and PHP. 我正在将Ubuntu 14.04.2 LTS与Apache2和PHP结合使用。

I have already installed PHP 5.5 (via apt-get ) and 5.2.17 (via installation from source). 我已经安装了PHP 5.5(通过apt-get )和5.2.17(通过从源代码安装)。 Can somebody tell me how to configure and use different PHP versions for each specified website? 有人可以告诉我如何为每个指定的网站配置和使用不同的PHP版本吗? Thanks. 谢谢。

You can get it by using PHP version manager and there are so many available, explore these: 您可以使用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 您可以使用Docker在一台服务器上运行多个PHP版本,请在另一线程中查看我的答案: 同一框上有多个PHP版本

Note that with this solution different PHP versions will be available on different ports. 请注意,使用此解决方案,可以在不同的端口上使用不同的PHP版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Virtphp和phpbrew:在一台服务器上设置具有不同PHP版本的两个不同应用程序 - Virtphp and phpbrew: setting up two different applications with different PHP versions on one server 如何在同一个 apache 服务器上为两个项目运行两个版本的 PHP - How to run two versions of PHP for two projects on same apache server 如何在Jquery,PHP和MySQL的一页上使用两种不同的形式 - How to use two different forms on one page with Jquery, PHP and MySQL 如何在运行不同 php 版本的服务器上安装 Laravel - How to install laravel on a server running different php versions PHPInfo / Valet - 两个不同的 PHP 版本 - PHPInfo / Valet - Two different PHP versions 在命令行中显示两个不同的PHP版本 - showing two different PHP versions in command line 在同一台机器上使用两个不同的PHP版本 - Using two different php versions on the same machine 如何处理不同版本的PHP - How to deal with different versions of PHP 如何在同一个 laravel 服务器中使用两个不同的数据库,一个来自 sql 服务器,另一个来自 mysql 服务器 - How to use two different database one from sql server and another from mysql server in same laravel application 在PHP中使用不同版本的Curl:一种有效,另一种无效 - Curl in different versions in PHP: one is working, other is not
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM