We’re happy to announce the release of LSWS 4.2.1, both to address an issue with php.ini location, but also to bump up PHP performance through streamlining PHP process launch.
We’ve gotten a lot of positive feedback on the new PHP suEXEC Daemon mode for LSWS 4.2 and PHP LSAPI 6.0. People have been excited by the reduced server load and performance boost they’re getting with shared PHP opcode and data cache. But we’ve also received a few bug reports complaining about strange behavior with PHP when handling sessions or cookies. We dug into these reports and found something in common — php.ini location had been overridden. When we designed PHP LSAPI 6.0, we added logic specifically for handling php.ini location changes. It shuts down PHP, changes the php.ini path, and starts the PHP engine again. We thought this was a pretty clever solution. Our internal testing shows that it works for phpinfo() output, but it causes troubles in production, like disappearing $COOKIES and $SESSIONS variables. We’ve released LSWS 4.2.1 to address this issue and to further upgrade PHP performance.
Unfortunately, we’re not going to solve this problem completely without heavily modifying PHP engine internals. So, we’re taking a half step back to ensure full functionality: When php.ini needs to be overridden for one user, LSWS 4.2.1 will automatically switch to Worker mode (LiteSpeed’s default suEXEC mode) and start a fresh PHP processes to meet PHP needs. This means opcode caches cannot be shared among multiple processes and the in-memory cache will be flushed for each process exit. It’s unfortunate that some of our users won’t be able to get all the advantages of LSWS, but there’s no better solution if the php.ini needs to be changed.
Even if your users are in Worker mode, though, LSWS 4.2.1 is still going to benefit them. In this release, PHP processes are launched through the light weight lscgid instead of the web server itself, reducing the system cost of starting a new PHP. All LiteSpeed users, whether using Daemon or Worker mode, will notice the difference in PHP performance.