Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to set a different PHP module per Virtual Host?

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?

like image 258
Cory Collier Avatar asked Jun 27 '10 14:06

Cory Collier


1 Answers

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.

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.

like image 143
Reece45 Avatar answered Oct 25 '22 01:10

Reece45