![图片[1]-CyberPanel面板安装失败无法安装lsphp的问题解决办法-主题铺](https://cdn.zhutipu.com/wp-content/uploads/2025/07/20250710162715279.webp/ztp)
最近主题铺在帮别人安装CyberPanel面板的时候,本来是一键安装的脚本,结果安装不久就提示错误。很奇怪。这里主题铺就仔细了解了一下,尝试了一些解决办法,最终成功安装了CyberPanel面板,这里主题铺就分享一下CyberPanel面板安装失败无法安装lsphp的问题解决办法。
首先,一键安装脚本大家都知道,自从官方将代码推送到gitee后,国内主机安装CyberPanel面板就快多了,不然安装时下载各类代码及扩展超级缓慢。现在gitee已有CyberPanel面板同步了官方的代码后,速度也快多了。地址:https://gitee.com/qtwrk/cyberpanel。
这里主要环境是Ubuntu 24.04,不懂是不是环境比较新的原因,安装这么多问题。
一键安装脚本:
sh <(curl https://cyberpanel.net/install.sh || wget -O - https://cyberpanel.net/install.sh)安装刚开始都是顺利的,结果到一半就提示错误,无法安装。如下报错
2026-05-23 09:42:19.238377 [NOTICE] [T0] Memory size is: 1982108KB.
2026-05-23 09:42:20.350548 [NOTICE] [T0] [OK] Updated license key has been created at /root/cyberpanel/install/lsws-6.3.5/license.key.
[OK] License key received.
2026-05-23 09:42:20.616359 [NOTICE] [T0] Memory size is: 1982108KB.
[OK] Leased license key 3 will expire in 30 days!
Please specify the user name of the administrator.
This is the user name required to log into the administration web interface.
User name [admin]:
Please specify the administrator's password.
This is the password required to log into the administration web interface.
Password:
Retype password:
Please specify administrators' email addresses.
It is recommended to specify a real email address,
Multiple email addresses can be set by a comma
delimited list of email addresses. Whenever something
abnormal happened, a notificiation will be sent to
emails listed here.
Email addresses [root@localhost]:
Will you use LiteSpeed Web Server with a hosting control panel?
0. NONE
1. cPanel
2. DirectAdmin
3. Plesk
4. Hsphere
5. Interworx
6. Lxadmin
7. ISPManager
Please select (0-7) [0]?
As you are the root user, you must choose the user and group
whom the web server will be running as. For security reason, you should choose
a non-system user who does not have login shell and home directory such as
'nobody'.
User [nobody]: Please choose the group that the web server running as.
User 'nobody' is the member of following group(s): nogroup nobody
Group [nogroup]:
Please specify the port for normal HTTP service.
Port 80 is the standard HTTP port, only 'root' user is allowed to use
port 80, if you have another web server running on port 80, you need to
specify another port or stop the other web server before starting LiteSpeed
Web Server.
You can access the normal web page at http://<YOUR_HOST>:<HTTP_PORT>/
HTTP port [8088]:
Please specify the HTTP port for the administration web interface,
which can be accessed through http://<YOUR_HOST>:<ADMIN_PORT>/
Admin HTTP port [7080]: Cannot find RUBY installation, remember to fix up the ruby path configuration
before you can use our easy RubyOnRails setup.
You can setup a global script handler for PHP with the pre-built PHP engine
shipped with this package now. The PHP engine runs as Fast CGI which
outperforms Apache's mod_php.
You can always replace the pre-built PHP engine with your customized PHP
engine.
Setup up PHP [Y/n]: Suffix for PHP script(comma separated list) [php]:
LiteSpeed Web Server Enterprise Edition can run in chroot environment.
It is impossible for the chrooted process and its children processes to
access files outside the new root directory.
With chroot configured properly, there is no need to worry about sensitive
data being accidentally exposed by insecure CGI programs or web server itself.
Even when a hacker some how gain a shell access, all files he can access is
under the chrooted directory.
This installation script will try to setup the initial chroot environment
automatically.
However, it is not easy to setup a chroot environment and you CGI program may
break. So we do not recommend enabling it for the first time user.
It can be enabled later by running this installation script again.
Enable chroot [y/N]:
Installing, please wait...
.....+.........+.....+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*...+....+.....+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*..............+....+...+..+..........+..+.+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
..+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*.+....+...+...+...+............+.........+........+.+..+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*.+...+....+......+........+............+...+......+..........+.....+......+.......+......+..+....+..............+.......+...+..+...+....+.....+.+............+..+.......+......+.....+....+......+...+.........+..+...+...+....+...+.....+...+...+..........+..+...+....+..+...+......+.......+...+.........+.....+...+.........+.+...+.....+.......+.................+.+............+..+...+.........+..........+.....+.+...+....................+.+...+......+...........+.+..+...+....+...+.....+......+....+.....+.......+.....+.+.........+.....+......+............+................+.....+......+....+..+.......+......+..+.......+......+..+.......+..+.+..+.......+.....+.........+....+.....+.......+......+...+.....+......+......+.........+....+.....+....+...+..+.+.....................+......+..+...+.......+...+.........+.....+....+..+..........+..+...............+...+...+.........+.+.....+......+..........+.....+......+....+..............+....+...+...+.........+..+.+..+............+...+.+......+..............+....+..+...+.+.....+.+......+..+.......+......+..+..........+...+.....+.......+..+......+....+...+..+..........+...+......+.....+.........+......+......+.+........+.........+..........+..+......+.......+......+.........+...........+.+...+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-----
cp: cannot stat '/root/cyberpanel/install/lsws-6.3.5/admin/misc/purge_cache_byurl.php': No such file or directory
chown: cannot access '/usr/local/lsws/admin/misc/purge_cache_byurl.php': No such file or directory
chmod: cannot access '/usr/local/lsws/admin/misc/purge_cache_byurl.php': No such file or directory
mv: cannot stat '/usr/local/lsws/modules': No such file or directory
Generating key pair for web console login page, please wait ...
can't find RSA private key in the string [-----BEGIN PRIVATE KEY-----
MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAmjG+laiTTdXgNdwr
yv5UprfHy5HWkmrhWkP3JB/3TObZmV0FEjMQHsXk2lWCgdOVHxCuUiHQh4ujGa4e
bd0idwIDAQABAkAOpWT18DI1tXf7hbM/L9M4
-----END PRIVATE KEY-----
]failed to parse key.pemUsing php to generate keys, please be patient ...
Created symlink /etc/systemd/system/multi-user.target.wants/lshttpd.service → /etc/systemd/system/lshttpd.service.
[OK] lshttpd.service has been successfully installed!
AWStats Integration
AWStats is a popular log analyzer that generates advanced web server
statistics. LiteSpeed web server seamlessly integrates AWStats into
its Web Admin Interface. AWStats configuration and statistics update
have been taken care of by LiteSpeed web server.
Note: If AWStats has been installed already, you do not need to
install again unless a new version of AWStats is available.
Would you like to install AWStats Add-on module [y/N]?
Congratulations! The LiteSpeed Web Server has been successfully installed.
Command line script - "/usr/local/lsws/bin/lswsctrl"
can be used to start or stop the server.
It is recommended to limit access to the web administration interface.
Right now the interface can be accessed from anywhere where this
machine can be reached over the network.
Three options are available:
1. If the interface needs to be accessed only from this machine, just
change the listener for the interface to only listen on the loopback
interface - localhost(127.0.0.1).
2. If the interface needs to be accessible from limited IP addresses or sub
networks, then set up access control rules for the interface accordingly.
3. If the interface has to be accessible via internet, SSL (Secure Sockets
Layer) should be used. Please read respective HOW-TOs on SSL configuration.
To change configurations of the interface, login and click
"Interface Configuration" button on the main page.
The administration interface is located at http://localhost:<ADMIN_PORT>/
or http://<ip_or_Hostname_of_this_machine>:<ADMIN_PORT>/
Would you like to have LiteSpeed Web Server started automatically
when the server restarts [Y/n]?
[OK] lshttpd.service has been successfully installed!
Would you like to start it right now [Y/n]?
2026-05-23 09:42:27.835691 [NOTICE] [T0] Memory size is: 1982108KB.
[OK] Leased license key 3 will expire in 30 days!
[OK] litespeed: pid=13314.
LiteSpeed Web Server started successfully! Have fun!
[05.23.2026_09-42-30] #########################################################################
[05.23.2026_09-42-30] Successfully ran: ./install.sh.
[05.23.2026_09-42-30] #########################################################################
[05.23.2026_09-42-30] #########################################################################
[05.23.2026_09-42-30] Running: chown -R lsadm:lsadm /usr/local/lsws/conf/
[05.23.2026_09-42-30] #########################################################################
[05.23.2026_09-42-30] #########################################################################
[05.23.2026_09-42-30] Successfully ran: chown -R lsadm:lsadm /usr/local/lsws/conf/.
[05.23.2026_09-42-30] #########################################################################
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package lsphp7?
E: Couldn't find any package by glob 'lsphp7?'
E: Couldn't find any package by regex 'lsphp7?'
E: Unable to locate package lsphp7?-common
E: Couldn't find any package by glob 'lsphp7?-common'
E: Couldn't find any package by regex 'lsphp7?-common'
E: Unable to locate package lsphp7?-curl
E: Couldn't find any package by glob 'lsphp7?-curl'
E: Couldn't find any package by regex 'lsphp7?-curl'
E: Unable to locate package lsphp7?-dev
E: Couldn't find any package by glob 'lsphp7?-dev'
E: Couldn't find any package by regex 'lsphp7?-dev'
E: Unable to locate package lsphp7?-imap
E: Couldn't find any package by glob 'lsphp7?-imap'
E: Couldn't find any package by regex 'lsphp7?-imap'
E: Unable to locate package lsphp7?-intl
E: Couldn't find any package by glob 'lsphp7?-intl'
E: Couldn't find any package by regex 'lsphp7?-intl'
E: Unable to locate package lsphp7?-json
E: Couldn't find any package by glob 'lsphp7?-json'
E: Couldn't find any package by regex 'lsphp7?-json'
E: Unable to locate package lsphp7?-ldap
E: Couldn't find any package by glob 'lsphp7?-ldap'
E: Couldn't find any package by regex 'lsphp7?-ldap'
E: Unable to locate package lsphp7?-mysql
E: Couldn't find any package by glob 'lsphp7?-mysql'
E: Couldn't find any package by regex 'lsphp7?-mysql'
E: Unable to locate package lsphp7?-opcache
E: Couldn't find any package by glob 'lsphp7?-opcache'
E: Couldn't find any package by regex 'lsphp7?-opcache'
E: Unable to locate package lsphp7?-pspell
E: Couldn't find any package by glob 'lsphp7?-pspell'
E: Couldn't find any package by regex 'lsphp7?-pspell'
E: Unable to locate package lsphp7?-recode
E: Couldn't find any package by glob 'lsphp7?-recode'
E: Couldn't find any package by regex 'lsphp7?-recode'
E: Unable to locate package lsphp7?-sqlite3
E: Couldn't find any package by glob 'lsphp7?-sqlite3'
E: Couldn't find any package by regex 'lsphp7?-sqlite3'
E: Unable to locate package lsphp7?-tidy
E: Couldn't find any package by glob 'lsphp7?-tidy'
E: Couldn't find any package by regex 'lsphp7?-tidy'
[05.23.2026_09-42-33] #########################################################################
[05.23.2026_09-42-33] Running: DEBIAN_FRONTEND=noninteractive apt-get -y install lsphp80*
[05.23.2026_09-42-33] #########################################################################
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package lsphp80*
E: Couldn't find any package by glob 'lsphp80*'
E: Couldn't find any package by regex 'lsphp80*'
[05.23.2026_09-42-34] #########################################################################
[05.23.2026_09-42-34] Running DEBIAN_FRONTEND=noninteractive apt-get -y install lsphp80* failed. Running again, try number 1
[05.23.2026_09-42-34] #########################################################################
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package lsphp80*
E: Couldn't find any package by glob 'lsphp80*'
E: Couldn't find any package by regex 'lsphp80*'
[05.23.2026_09-42-34] #########################################################################
[05.23.2026_09-42-34] Running DEBIAN_FRONTEND=noninteractive apt-get -y install lsphp80* failed. Running again, try number 2
[05.23.2026_09-42-34] #########################################################################
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package lsphp80*
E: Couldn't find any package by glob 'lsphp80*'
E: Couldn't find any package by regex 'lsphp80*'
[05.23.2026_09-42-35] #########################################################################
[05.23.2026_09-42-35] Running DEBIAN_FRONTEND=noninteractive apt-get -y install lsphp80* failed. Running again, try number 3
[05.23.2026_09-42-35] #########################################################################
[05.23.2026_09-42-35] #########################################################################
[05.23.2026_09-42-35] [ERROR] We are not able to run DEBIAN_FRONTEND=noninteractive apt-get -y install lsphp80* return code: 100. Fatal error, see /var/log/installLogs.txt for full details.
[05.23.2026_09-42-35] #########################################################################
Oops, something went wrong...
或者报错
[05.23.2026_10-44-16] #########################################################################
[05.23.2026_10-44-16] Running: DEBIAN_FRONTEND=noninteractive apt-get -y install openlitespeed
[05.23.2026_10-44-16] #########################################################################
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package openlitespeed
[05.23.2026_10-44-16] #########################################################################
[05.23.2026_10-44-16] Running DEBIAN_FRONTEND=noninteractive apt-get -y install openlitespeed failed. Running again, try number 1
[05.23.2026_10-44-16] #########################################################################
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package openlitespeed
[05.23.2026_10-44-16] #########################################################################
[05.23.2026_10-44-16] Running DEBIAN_FRONTEND=noninteractive apt-get -y install openlitespeed failed. Running again, try number 2
[05.23.2026_10-44-16] #########################################################################
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package openlitespeed
[05.23.2026_10-44-16] #########################################################################
[05.23.2026_10-44-16] Running DEBIAN_FRONTEND=noninteractive apt-get -y install openlitespeed failed. Running again, try number 3
[05.23.2026_10-44-16] #########################################################################
[05.23.2026_10-44-16] #########################################################################
[05.23.2026_10-44-16] [ERROR] We are not able to run DEBIAN_FRONTEND=noninteractive apt-get -y install openlitespeed return code: 100. Fatal error, see /var/log/installLogs.txt for full details.其实具体哪里的问题呢?脚本中自带的密钥地址 https://rpms.litespeedtech.com/debian/litespeed.gpg 已经不再有效,没有验证的话,就无法下载官方仓库的内容。而方法是直接通过一个 shell 脚本来完成仓库和密钥的设置。
解决方案:使用 LiteSpeed 官方脚本安装仓库和密钥
1. 彻底清理所有旧的 LiteSpeed 仓库配置和 GPG 密钥
在进行任何新操作之前,务必清理之前尝试留下的所有残留文件,以避免冲突。
# 移除所有可能存在的 LiteSpeed APT 仓库文件
sudo rm -f /etc/apt/sources.list.d/litespeed.list
sudo rm -f /etc/apt/sources.list.d/*litespeed*.list
sudo rm -f /etc/apt/sources.list.d/lst_*.list
# 移除所有可能存在的 LiteSpeed GPG 密钥
sudo rm -f /etc/apt/trusted.gpg.d/repo.litespeed.sh.gpg
sudo rm -f /etc/apt/trusted.gpg.d/litespeed.gpg
sudo rm -f /etc/apt/keyrings/litespeed.gpg
sudo rm -f /etc/apt/keyrings/litespeed-sh.gpg
# 确保 apt 的状态是最新的
sudo apt clean
sudo apt update --fix-missing2. 安装必要的依赖(如果尚未安装)
sudo apt update
sudo apt install -y wget curl unzip software-properties-common gnupg ca-certificates3. 使用 LiteSpeed 官方脚本添加仓库和 GPG 密钥
这是关键一步。LiteSpeed 提供了一个便捷的 shell 脚本来自动设置其 APT 仓库和导入 GPG 密钥。
sudo wget -O - https://repo.litespeed.sh | sudo bash请运行此命令并仔细检查其输出。 您应该会看到类似以下的信息,表明它正在下载 GPG 密钥并设置仓库:
...
register LiteSpeed GPG key
...
LiteSpeed repository has been setup!
...如果这一步没有报错,说明 LiteSpeed 仓库和 GPG 密钥应该已经正确添加。
4. 更新软件包列表
在添加新仓库后,必须更新 APT 软件包列表,以便 APT 能够识别新仓库中的软件包。
sudo apt update6. 重新运行 CyberPanel 安装
CyberPanel的安装脚本继续运行,再次安装CyberPanel,这次没有错误了。一次安装完成。
我后来查了一下原因
Ubuntu 24.04 (Noble) 对 APT 的 GPG 密钥管理有了更严格的要求。直接将密钥放到 /etc/apt/trusted.gpg.d/ 或使用 apt-key add 的老方法可能不再被完全支持,而且密钥需要以 signed-by 的方式在 .list 文件中明确指定路径。
LiteSpeed 官方的 https://repo.litespeed.sh 脚本就是为了处理这些复杂性而设计的,它会自动将 GPG 密钥导入到正确的目录(例如 /etc/apt/keyrings/ 或 trusted.gpg.d 并设置正确的权限),然后配置 sources.list.d 文件以 signed-by 方式引用密钥。

















暂无评论内容