Topic: PHP for LiteSpeed Web Server

Hi Remi,

I don't know if you've ever had this request, but we (LiteSpeed Technologies) would love to see PHP RPMs for LiteSpeed Web Server in the Remi repository. They're not much different from PHP RPMs for Apache except that they have the --with-litespeed option added.

What do you think? We'd steer a bunch of LSWS users your way. (Plus we would be forever grateful and you'd be helping web hosts everywhere give people faster sites.)

Cheers,

Michael

Re: PHP for LiteSpeed Web Server

> I don't know if you've ever had this request
No, first time.

> What do you think?
According to LiteSpeed documentation, lsws is able to use FastCGI, so php-fpm.
This is probably a good solution, as fpm is actively maintained.

As I have to build PHP 5.5.15RC1, I temporary enable LSAPI support.
So package in remi-test (el6 and el7), have the php-litespeed package which provides the "lsphp" command.

Of course I expect your feedback (tests result).
And I will consider to enable it in final 5.4.31, 5.5.15 and next 5.6.0 RC.

Remi.

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: PHP for LiteSpeed Web Server

Hi Remi,

Very nice to meet you, by the way.

The developers have done preliminary testing — no problems with php-litespeed. Thanks! We and our users would be really grateful if you'd include this in the repository.

The developers do have some suggestions, though:

This version of LSAPI is a little out of date. You can always get the latest release from our site: http://www.litespeedtech.com/packages/l … est.tar.gz You would just need to just overwite *.c and *.h in the php-5.x.x/sapi/litespeed/. The other files in there don't need to be touched.

They also suggest that, instead of naming the binary just lsphp, you might want to name the binary lsphp55, lsphp54, etc. LSWS users often have multiple versions of PHP at once.

And, of course, we'd be happy to help with the rpm spec file.

Thank you again!

Oh, one last question — on my personal remi installation, remi.repo doesn't have remi-php55. Why would that be? It has remi and remi-test...

Cheers,

Michael

Re: PHP for LiteSpeed Web Server

> This version of LSAPI is a little out of date. You can always get the latest release from our site: http://www.litespeedtech.com/packages/l … est.tar.gz You would just need to just overwite *.c and *.h in the php-5.x.x/sapi/litespeed/. The other files in there don't need to be touched.

I don't want to alter php sources.

litespeed have recently be updated to 6.4 in php 5.4+ and 6.6 in php 5.6+

> They also suggest that, instead of naming the binary just lsphp, you might want to name the binary lsphp55, lsphp54, etc. LSWS users often have multiple versions of PHP at once.

This not possible, as it won't be possible to install both versions because of dependencies (php-common and other extensions)

The only solution to correctly manage parallel installation is SCL (for now, I don't plan to provide SCL build of PHP)

> Oh, one last question — on my personal remi installation, remi.repo doesn't have remi-php55. Why would that be? It has remi and remi-test...

The updated file is provided by latest remi-release package.
Check if you have a remi.repo.rpmnew.

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: PHP for LiteSpeed Web Server

Bad reading of the git history.
George wang have updated to LSAPI 6.6 in 5.4+

So this version will be in 5.4.31 / 5.5.15 (except if reverted by RM as this should not have happen after RC,  but at least in 5.4.32 / 5.5.16)

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: PHP for LiteSpeed Web Server

> I don't want to alter php sources.

Completely understandable.

> The only solution to correctly manage parallel installation is SCL (for now, I don't plan to provide SCL build of PHP)

It would be great if you did someday, but I can imagine that might be a lot of work...

> Check if you have a remi.repo.rpmnew.

Ah, yes. Thanks!

And thanks again for including LSAPI! This is going to be of great help to our users.

Cheers,

Michael

Re: PHP for LiteSpeed Web Server

> So this version will be in 5.4.31 / 5.5.15 (except if reverted by RM as this should not have happen after RC,  but at least in 5.4.32 / 5.5.16)
Have been reverted (to respect the normal RC / final workflow)

So, php-litespeed will available in 5.4.31 / 5.5.15 RPM, but with the old API.
And new API will be in 5.4.32 / 5.5.16 (in 1 month)

Remi

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: PHP for LiteSpeed Web Server

Remi wrote:

> So this version will be in 5.4.31 / 5.5.15 (except if reverted by RM as this should not have happen after RC,  but at least in 5.4.32 / 5.5.16)
Have been reverted (to respect the normal RC / final workflow)

So, php-litespeed will available in 5.4.31 / 5.5.15 RPM, but with the old API.
And new API will be in 5.4.32 / 5.5.16 (in 1 month)

Remi

Works for me! Thanks!

Re: PHP for LiteSpeed Web Server

Performance

PHP LSAPI's optimized coding and use of native LiteSpeed configurations makes LSWS + LSAPI the fastest way to serve PHP:

Up to 20% better performance than FastCGI.
Up to 50% faster than Apache with mod_PHP and 75% faster than nginx with PHP-FPM.
LiteSpeed's suEXEC Daemon and ProcessGroup modes fork PHP processes instead of creating new processes. This means more efficiency and allows secure opcode cache use even in shared hosting.
Security

PHP LSAPI fully supports suEXEC mode, a necessity for shared hosting.
PHP LSAPI allows you to jail a PHP process with chroot.
Flexibility

Change PHP configurations via web server configuration or .htaccess files.
Run multiple versions of PHP at once and easi

Re: PHP for LiteSpeed Web Server

>> The only solution to correctly manage parallel installation is SCL (for now, I don't plan to provide SCL build of PHP)
> It would be great if you did someday, but I can imagine that might be a lot of work...

See http://blog.famillecollet.com/post/2014 … Collection

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: PHP for LiteSpeed Web Server

Cool! But does this mean you're only going to have SCL for PHP 5.6? (I can ask this somewhere else, if you'd like.)

Michael

Re: PHP for LiteSpeed Web Server

> But does this mean you're only going to have SCL for PHP 5.6?

I don't know yet...
I'd like to also provide 5.4 and 5.5... but... Days only have 24 hours...

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: PHP for LiteSpeed Web Server

New php54 SCL is now available (fedora 19,20,21 - RHEL 6,7 - x86_64)
(of course with LiteSpeed support)

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: PHP for LiteSpeed Web Server

New php55 SCL is now available (fedora 21 - RHEL 6,7 - x86_64)
Of course with LiteSpeed support

Not yet announced (on the blog), pecl extension rebuild in progress..

So now, all maintained PHP versions can be parallel installed. smile

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: PHP for LiteSpeed Web Server

Not bad! (How did you manage to get more than 24 hours in your days? I would like more time in my days, too.)

We'll definitely be looking into these and I'll add SCL usage to the documentation. We're planning our updating our own repo, too, but a big reason for it was SCL. Now I'm not so sure...

This is pretty sweet.

m

(Sorry I didn't reply to the other posts. For some reason I didn't get email notification... I only saw your new posts because I wanted to update the thread after reading the blog.)

Re: PHP for LiteSpeed Web Server

> How did you manage to get more than 24 hours in your days?
Heavy usage of "IP Over Time" http://kadreg.org/ipot/

What do you think of adding support for lsphp as a service (adding a sysv init script / systemd unit file) ?
Is there a lot of usage of this configuration (LiteSpeed frontend and PHP backend on different computer) ?

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi