有没有办法为每个虚拟主机设置不同的 PHP 模块? [英] Is there a way to set a different PHP module per Virtual Host?

查看:28
本文介绍了有没有办法为每个虚拟主机设置不同的 PHP 模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在本地机器上为一堆网站开发.其中一些站点最终运行在 php5.3 上,一些运行在 php5.2 上.有没有办法设置虚拟主机来为每个虚拟主机使用不同版本的 php?

I'm developing for a bunch of sites on my local machine. Some of those sites ultimately run on php5.3, and some run on php5.2. Is there a way I can setup virtual hosts to use different versions of php for each?

推荐答案

您应该能够手动编译两个版本的 PHP 以分隔目录并为每个网站设置带有 FastCGI 的 PHP.FastCGI 将为您提供与 apache 上的 mod_php 相当的性能.

You should be able to manually compile both versions of PHP to separate directories and setup PHP with FastCGI for each website. FastCGI will give you comparible performance to mod_php on apache.

您也可以使用 CGI 设置每一个.它慢了很多,但是你看不到像 APC 这样的模块如何帮助你的代码或使用的共享内存或持久连接可靠(它们只适用于一个请求)

You could also set each one up with CGI. Its a lot slower, but then you can't see how modules like APC will help your code or used shared memory or persistent connections reliable (they will work for just one request)

如果这不起作用,您可以再次安装您的网络服务器,将其配置为在不同的端口上运行,然后将您的其他网络服务器设置为代理,将请求转发到特定的虚拟主机以另一个网络服务器.

If that doesn't work, you can make a second install of your webserver, configure it to run on a different port, and then set up your other webserver to act as a proxy, forwarding requests to a specific virtual host to the other webserver.

这篇关于有没有办法为每个虚拟主机设置不同的 PHP 模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆