lsphp Configuration
Learning Focus
By the end of this lesson you will know how to set up the lsphp external application in WebAdmin, configure the command path, and verify it runs correctly.
What lsphp Configuration Does
The lsphp external application definition tells OpenLiteSpeed which PHP binary to use, how to communicate with it, and what resource limits to apply.
Configuring in WebAdmin
Step 1: Navigate to External Apps
- Go to Server Configuration → External App (or per-vhost External App)
- Click Add
Step 2: Fill in the Settings
| Setting | Value | Notes |
|---|---|---|
| Name | lsphp84 | Descriptive name |
| Address | uds://tmp/lshttpd/lsphp.sock | Unix domain socket path |
| Max Connections | 35 | Adjust based on RAM |
| Command | /usr/local/lsws/lsphp84/bin/lsphp | Path to the lsphp binary |
| Instances | 1 | Usually 1 for auto-management |
| Environment | PHP_LSAPI_MAX_REQUESTS=1000 | Optional tuning |
Step 3: Save and Test
# Verify the binary exists
ls -la /usr/local/lsws/lsphp84/bin/lsphp
# Reload OpenLiteSpeed
sudo /usr/local/lsws/bin/lswsctrl restart
# Check that lsphp processes start
ps aux | grep lsphp | grep -v grep
# Test PHP execution
curl http://localhost/info.php
info
The Command path must point to the correct lsphp binary for your desired PHP version. Different versions have different binary paths (e.g., lsphp81, lsphp83, lsphp84).
Common Configuration Mistakes
| Mistake | Symptom | Fix |
|---|---|---|
| Wrong binary path | 503 error on PHP pages | Verify path with ls -la |
| Socket permission issue | Connection refused | Check /tmp/lshttpd/ permissions |
| Max connections too low | Slow under load | Increase, but check RAM |
| Missing PHP extensions | Application errors | Install missing lsphp84-* packages |
Key Takeaways
- The external app definition connects OpenLiteSpeed to a specific PHP binary.
- Always verify the binary path, socket path, and connection limits.
- Test with a simple PHP file after any configuration change.
What's Next
- Continue to Socket Configuration for detailed socket setup.