Ubuntu Server(OpenLiteSpeed)下多版本lsphp扩展包安装失败求助
Hey there, let's work through fixing those package-not-found errors you're hitting when trying to install LSPHP extensions. The core issue here is that Ubuntu's default apt repositories don't host these OpenLiteSpeed-specific PHP packages—they're maintained directly by OpenLiteSpeed, so we need to add their official repo first.
Step 1: Add OpenLiteSpeed's Official Repository
First, we'll import the repo's GPG key to ensure the packages we download are trusted, then add the repository to your system's apt sources:
# Import the OpenLiteSpeed GPG key wget -O - https://rpms.litespeedtech.com/debian/lst_repo.gpg | sudo apt-key add - # Add the repository to your apt sources list echo "deb https://rpms.litespeedtech.com/debian/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/lst_debian_repo.list
Step 2: Refresh Your Apt Cache
Now update your apt package index to recognize the new repository:
sudo apt update
Step 3: Re-Run Your Installation Commands
With the official repo added, you should now be able to install those LSPHP packages without errors. Go ahead and re-run the apt-get install commands you tried earlier.
Quick Note on Package Names
If you still run into a hiccup with a specific package, double-check the naming—OpenLiteSpeed sometimes uses minor variations from standard PHP package conventions. For most cases though, the names you used should work perfectly once the repo is added.
Step 4: Verify the Installation
After installation, confirm that the LSPHP versions are set up correctly with:
# Check LSPHP 7.0 version lsphp70 -v # Verify other versions similarly lsphp71 -v lsphp72 -v lsphp73 -v lsphp74 -v lsphp80 -v
That should clear up all the "unable to locate package" and "no installation candidate" errors you were facing. Let me know if you hit any unexpected snags along the way!
内容的提问来源于stack exchange,提问作者Suresh Ramani

