简体   繁体   English

是否可以在apache的不同目录中使用多个版本的php?

[英]Is it possible to use multiple version of php in different directory in apache?

I would like to use 2 php versions on same domain is it possible ? 我想在同一域上使用2个php版本吗?

http://www.example.com -> php 5 http://www.example.com- > PHP 5

http://www.example.com/newphp -> php7 http://www.example.com/newphp- > php7

and how? 如何?

I'm using Centos 6x 我正在使用Centos 6x

Thank you. 谢谢。

Yes it's possible with PHP-FPM, but not out of the box, as far as I know. 是的,使用PHP-FPM可以实现,但据我所知并非开箱即用。 You will have to do some compiling from source, and then some fancy Apache configuration. 您将必须从源代码进行一些编译,然后再进行一些精美的Apache配置。 I can point you to an internet resource to get you started, but be aware this is not a task for the inexperienced. 我可以为您提供互联网资源以帮助您入门,但是请注意,对于没有经验的人来说,这不是一项任务。

The basic steps to compile PHP-FPM and Apache on CentOs are described in the first part of this tutorial: 本教程的第一部分介绍了在CentO上编译PHP-FPM和Apache的基本步骤:

https://www.howtoforge.com/how-to-build-php-5.6-fpm-fastcgi-with-zend-opcache-and-apcu-for-ispconfig-3-on-debian-7-wheezy https://www.howtoforge.com/how-to-build-php-5.6-fpm-fastcgi-with-zend-opcache-and-apcu-for-ispconfig-3-on-debian-7-wheezy

You can install a second PHP-FPM version the same way you installed the first, and then configure which PHP pool you want to use in your Apache config or .htaccess files. 您可以像安装第一个PHP-FPM一样安装第二个PHP-FPM版本,然后在Apache config或.htaccess文件中配置要使用的PHP池。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM