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 non-daemon mode and start a fresh PHP process with a customized php.ini. For this user, 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 users won’t get all the advantages of LSWS, but there’s no better solution if the php.ini needs to be changed. Other users, without a customized php.ini, won’t be affected and will stay in daemon mode. You do not need to worry about whether a user has a different php.ini. LSWS will automatically switch to the optimal solution.
Even if your users are in non-daemon mode, though, LSWS 4.2.1 is still going to benefit them. In this release, PHP processes are launched through light weight lscgid instead of the web server itself, reducing the system cost of starting a new PHP. All your users will notice the difference in PHP performance.