APVH and Script Handlers

#1
Hello,

I'm having trouble getting the correct PHP version served when the default handler is used, which I believe is application/x-httpd-lsphp. When other handlers are used, such as application/x-httpd-php71, the correct PHP version is served.

There's no mention of any of these handlers in any of the configuration files (as well as the Web Console, obviously), and I haven't been able to find them documented on the site.

Is there a list of handlers available?
Is there documentation on how APVH behaves?
Is there documentation on how LSWS chooses the PHP version from the default handler?

LSWS 5.4.7, DirectAdmin 1.61

Thanks!
 
#3
Thanks for the reply @NiteWave. Indeed that was a limitation at one time, but now DirectAdmin supports 4 PHP versions (and soon to be 6).

I don't think that's specifically the case here; what's happening is LiteSpeed is using APVH mode and reading the DirectAdmin Apache configs. When using the default PHP version in DirectAdmin, there is no handler written to the Apache config. This means LiteSpeed chooses which PHP version to use.

It's unclear how LiteSpeed chooses this value. APVH seems mostly undocumented.
 

NiteWave

Administrator
#4
during litespeed start up, can you grep message similar as below in error.log
Code:
Create PHP handler [ea-php51] with PHP binary [/opt/cpanel/ea-php51/root/usr/bin/lsphp]
Add #1 suffix handler [ea-php51]->[ea-php51].
Associate [php51] with PHP handler [ea-php51].
 

Pong

Administrator
Staff member
#5
LiteSpeed Enterprise integration was done by DirectAdmin developer. LiteSpeed will read apache configuration file and use the same version of php apache use. For handler, apache may use lsphp/php-fpm/fastcgi, while LiteSpeed will only use lsphp. Everything will be controlled by custombuild.

vi /usr/local/directadmin/custombuild/options.conf

In term of documentation, you may check with DirectAdmin doc to see if you can find full documentation.

By the way, "getting the correct PHP version served when the default handler is used, " What version of PHP apache using, LiteSpeed should use the same, If not, please give an detailed example, we can check further. but keep in mind, integration was done by DA, it could be a custom build bug if LiteSpeed doesn't use the same as apache. most likely you should log a bug report to DA.
 
#6
Thanks for the responses.

I ended up creating External Apps and Script Handlers for all the versions of PHP I had compiled. And then for the version of PHP that DirectAdmin uses as default, I set the Script Handler for that version to have the `php` extension as well as the versioned extension (`php73` in my case), because DirectAdmin won't set AddHandler in the configuration for the default PHP version. DirectAdmin docs cover this somewhat but they looked out of date.

I think the confusion was that I did have these settings originally, in some capacity, but without them, everything still continued to work for the most part, except the default PHP version since it had no AddHandler in the httpd-compatible configuration. The only thing that made things clear was when poking around the LiteSpeed Web console, the tooltip for Suffixes when creating a Script Handler mentioned it setup the accompanying handler (application/x-httpd-XXXX).

I was hoping to get some clarity on how LiteSpeed knew where to find `lsphp` for APVH configurations that _did_ set an AddHandler, but I guess that's not necessary now.
 
Top