Configuring LSAPI environment variables

adam12

Verified User
Joined
Feb 19, 2016
Messages
81
Has anybody been able to configure the LSAPI environment for LSPHP? Specifically, I'm looking to add LSAPI_SLOW_REQ_MSECS=10000 as an environment variable, but it's a complete mystery on how.

There's zero reference to the PHP handlers in either /usr/local/lsws, /etc/httpd/conf, or /usr/local/directadmin/data. Maybe they are auto-configured?

Adding it through the LSWS Web Console should work, but there's no handlers listed there either, and then if you update the PHP Handler Defaults section to include the environment variable, you need to fill out every field in that section, overriding the presumably default values that are unknown.
 
Configuration->External App->lsphp5->Edit->Environment.
 
It shouldn’t be like this, unless you’re accessing a wrong section. If it’s a correct one - I’d suggest contacting LiteSpeed support.
 
As a follow up, LiteSpeed was able to set this value for me. They did it through Configuration -> Server -> PHP, under PHP Handler Defaults.

Ironically, they had to set values for the other fields I was concerned about, with values I wasn't aware of. I pushed them on this and they said they were the defaults as listed in the tooltips, but there were no values in the tooltips so presumably they have these numbers listed elsewhere. I'll attach a screenshot in case anybody else runs into this.
Global PHP Settings - LiteSpeed WebAdmin Console.png
 
It shouldn’t be like this

I actually think you're right. The fact that it's working at all seems to be a feature of LiteSpeed.

During an upgrade a while back, I removed all handlers since everything was functioning without them and it was unclear if they were still necessary. After poking around, I think they are, at least if I want it to function sanely and not let LiteSpeed manage it for me.
 
Further follow-up,

I added External Apps and Script Handlers for all 4 PHP versions. For the default PHP version (php1_release in options.conf), I made sure that the Script Handler for that PHP version also had the `php` extension.

The documentation somewhat mentions adding them, but without any External Apps or Script Handlers, LiteSpeed somehow figures most of it out, except for the default PHP version since DirectAdmin doesn't generate an `AddHandler` call in httpd.conf.
 
Back
Top