Skip to main content

Command Setup

Learning Focus

By the end of this lesson you will know how to set the correct command path for lsphp and troubleshoot binary-not-found errors.

What the Command Setting Does

The Command field in the external application definition tells OpenLiteSpeed which binary to execute when it needs a PHP worker. If this path is wrong, PHP pages return 503 errors.

Finding the Correct Binary

# List available lsphp versions
ls -la /usr/local/lsws/lsphp*/bin/lsphp

# Check a specific version
/usr/local/lsws/lsphp84/bin/lsphp -v

# Expected output:
# PHP 8.4.x (litespeed) ...

Setting the Command in WebAdmin

  1. Server ConfigurationExternal App → select or add lsphp app
  2. Set Command: /usr/local/lsws/lsphp84/bin/lsphp
  3. Save and Graceful Restart

Common Problems

ProblemCauseFix
503 on all PHP pagesWrong binary pathVerify with ls -la
Binary not foundlsphp not installedsudo apt install lsphp84
Wrong PHP versionPath points to old versionUpdate to correct lsphpXX path
Permission deniedBinary not executablechmod +x /usr/local/lsws/lsphp84/bin/lsphp

Key Takeaways

  • The command path must point to a valid, executable lsphp binary.
  • Verify the binary exists and works before configuring.
  • 503 errors on PHP pages almost always trace back to the external app command or socket.

What's Next