LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > External Applications > PHP > Running PHP 4 and 5 in parallel

Reply
 
Thread Tools Display Modes
  #1  
Old 06-19-2006, 09:32 AM
Sasa Sasa is offline
New Member
 
Join Date: Jun 2006
Posts: 6
Default Running PHP 4 and 5 in parallel

Hi there,

this is my first post here. I am having another look at litespeed and really like what I am seeing so far. Now to my question.

I am wondering how to run both PHP 4 and 5 on the same server. I have about 30 vhosts on this one machine (still running apache) of which I want to run most sites on PHP 5. But there are a couple of older sites which I have no time to port to PHP 5. Running PHP 4 and 5 on the same Apache instance is a real pain and so I am wondering on how to do it with lsws since I really want to migrate all my PHP development to version 5.1.x.

Any hints?
Reply With Quote
  #2  
Old 06-19-2006, 11:07 AM
xing xing is offline
LiteSpeed Staff
 
Join Date: Oct 2003
Location: Los Angeles, California
Posts: 380
With litespeed you can easily mix and max different version of existing backend technologies:

1) Define both "PHP4" and "PHP5" instances in "External Applications".

2) Use script handlers to give "PHP4" to scripts named php or php4 and "PHP5" workers to scripts named php5.

Last edited by xing; 06-19-2006 at 11:17 AM..
Reply With Quote
  #3  
Old 06-19-2006, 11:53 AM
ts77 ts77 is offline
Senior Member
 
Join Date: Nov 2004
Posts: 288
I'm actually running both php-versions because of the same very reason, legacy applications .

Go with 1), define both php-installs as handlers in external applications (the big difference to apache is that they run as fastcgi, not module)
and override the global script handlers for each vhost the way you want, so you can use .php for php4 in one host, .php for php5 in another host.
Reply With Quote
  #4  
Old 06-19-2006, 01:33 PM
Sasa Sasa is offline
New Member
 
Join Date: Jun 2006
Posts: 6
Good to know. Now I have no excuse to not actually try it out

I knew that you could do that with FastCGI. You can use any webserver that supports FastCGI to do this. I guess I should have asked if the lsapi supports this. I tried to lear more about it, but could only find a dead link to

http://www.litespeedtech.com/lsapi/

So, can lsapi do it or do I have to use FastCGI for this?
__________________
-Sasa
Reply With Quote
  #5  
Old 06-19-2006, 01:40 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
Yes, you can use lsapi, it works in the similar way as FastCGI, just faster due to the optimization in protocol.
Reply With Quote
  #6  
Old 06-19-2006, 02:50 PM
xing xing is offline
LiteSpeed Staff
 
Join Date: Oct 2003
Location: Los Angeles, California
Posts: 380
Sasa,

Thanks for pointing out the the faulty url. /lsapi/ is an old link from our previous web site but we overlooked it when creating important redirects to smooth the transition. Problem fixed. /lsapi/ will now be redirected to the correct page.
Reply With Quote
  #7  
Old 10-11-2006, 04:03 AM
intel352 intel352 is offline
New Member
 
Join Date: Oct 2006
Posts: 3
Quote:
Originally Posted by mistwang View Post
Yes, you can use lsapi, it works in the similar way as FastCGI, just faster due to the optimization in protocol.
So both PHP 4 and PHP 5 could be run in parallel using lsapi?

Additionally, you said that lsapi functions similar to fastcgi, but faster, so does that mean it's performance is comparable to that of apache's mod_php, or is it faster? (I ask, because I know that FastCGI PHP doesn't seem to be *quite* as fast as mod_php, under apache)
Reply With Quote
  #8  
Old 10-11-2006, 10:14 AM
xing xing is offline
LiteSpeed Staff
 
Join Date: Oct 2003
Location: Los Angeles, California
Posts: 380
LSAPI PHP is much more scalable than mod_php not because it can excecute script faster but because it is much more resource efficient. Instead of having every single Apache process bind with mod_php even for requests that do not need it, LSAPI PHP creates a worker pool of php processes and thrink and expand as demand.
Reply With Quote
  #9  
Old 10-11-2006, 10:22 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
And both FCGI PHP and LSAPI PHP with LiteSpeed is faster than Apache's mod_php. LSAPI PHP is the fastest. Apache's mod_fastcgi is not as fast as ours.
Please checkout our benchmark page.

Last edited by mistwang; 10-11-2006 at 10:26 AM..
Reply With Quote
  #10  
Old 10-19-2006, 04:01 PM
dreamscape dreamscape is offline
Member
 
Join Date: Oct 2006
Posts: 28
I just wanted to add a quick note that I am running both PHP 4 and PHP 5.1 as LSAPI. Not only does it work great, but it was also incredibly easy to set up... Way easier than getting them running them in parallel in Apache (where one has to be CGI unless you run 2 Apache servers and proxy one to the other... yuk ;-) )
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
replacing system php felosi PHP 3 07-16-2007 11:23 PM
setup php in rails template cswilliams Install/Configuration 2 01-25-2007 08:21 AM
Running Rails and PHP in parallel under the same virtual domain/host adriatic Ruby/Rails 1 11-10-2006 08:52 AM
Best configuration for PHP LiteSpeed SAPI jeff Install/Configuration 6 10-19-2005 09:54 AM
1.5RC1 context xing Bug Reports 2 04-28-2004 09:27 AM


All times are GMT -7. The time now is 09:51 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.