PHP4 and PHP5.

#1
Hello!

Sorry for my English, I'm from Poland :)

Now I have PHP4. But I want have PHP4 and PHP5 (on one server, on LiteSpeed).
As I can start up PHP4 and PHP5 on server?
(file *.php - PHP4, file *.php5 - php5).

Thanks,
Martin.
 
Last edited:

aemadrid

Well-Known Member
#3
PHP4 AND PHP5 with LSAPI?

yes you can. define the fast-cgi handlers like that. just make them use different sockets.
Is there any way to get PHP4 and PHP5 working through LSAPI instead of FCGI? I'm new to LS so forgive me if I'm wrong but I thought LSAPI was the better performer.

Thanks in advance,


Adrian Madrid
 

ts77

Well-Known Member
#4
Is there any way to get PHP4 and PHP5 working through LSAPI instead of FCGI? I'm new to LS so forgive me if I'm wrong but I thought LSAPI was the better performer.

Thanks in advance,


Adrian Madrid
same applies to lsapi of course.
I'm just using only fcgi because of missing lsapi patches in gentoo's php and my own thoughts of stability (not meaning lsapi is unstable, just that its not included anywhere yet).
 

aemadrid

Well-Known Member
#5
PHP4 and PHP5 with LSAPI

same applies to lsapi of course.
I'm just using only fcgi because of missing lsapi patches in gentoo's php and my own thoughts of stability (not meaning lsapi is unstable, just that its not included anywhere yet).
Forgive me again but I'm just an LS noobie. How do you setup LSAPI for both? Do you compile PHP4 and PHP5 and copy php4 to lsphp4 and php5 to lsphp5 tot he /lswsinstall/fcgi-bin/ directory? Just trying to figure out how to setup things so LS can use both php4 and php5 in different context. BTW, a Wiki HowTo would be really cool.

Thanks gain,


Adrian Madrid
 

aemadrid

Well-Known Member
#7
PHP4 and PHP5 with LSAPI

Adrian,

Here is our wiki how-to for PHP 4/5 with LSAPI:

http://www.litespeedtech.com/support/wiki/doku.php

You can also find our wiki by using our top site menu under "Support".
Xing,

I have read and followed that WIKI to get PHP4 running through LSAPI. My question is, how do I add PHP5 to the mix so I can do both PHP4 and PHP5 through LSAPI. In step 6 of the wiki says:

cd /lswsinstall/fcgi-bin/
mv lsphp lsphp.old
cp /php-src/sapi/litespeed/php lsphp

Now that I have already done that for PHP4 and want to add PHP5 what do I do? Do I copy the new PHP5 compiled as lsphp5? What else do I need to do to have both available?

Thanks in advance,


Adrian Madrid
 

xing

LiteSpeed Staff
#8
1) You can cp the php4 binary as lsphp4 and php 5 binary as lsphp5 in the fcgi-bin directory.

2) Modify the "Server -> External Apps" definitions so that the current one is renmed to like php4LSAPI and points to lsphp4 and the socket is renamed to like lsphp4.sock.

Then create a new "Server -> External App" definition just like the php4 one except all references to php4 is replaced with php5.

3) Go to "Server -> Script Handler" and here you decide which php (4 or 5) you want to use with the default .php extension. Then create a new script handler to bind to bind the other to a file suffix of your choice. For example, let .php bind to php4 and .php5 for php5 or vice versa.
 

aemadrid

Well-Known Member
#9
...
3) Go to "Server -> Script Handler" and here you decide which php (4 or 5) you want to use with the default .php extension. Then create a new script handler to bind to bind the other to a file suffix of your choice. For example, let .php bind to php4 and .php5 for php5 or vice versa.
Thanks! That part is what I was looking for. This seems to me the cleanest implementation of PHP4/PHP5 in one server. If I understand this right I could have two contexts in a vhost serving with a different PHP in each (e.g., /blog with php4 and /crm with php5). Heck, I could have all versions of PHP I want that. I must say I'm impressed with LS so far. It has a learning curve but so far it seems worth it.
 
Top