解决方案php:error while loading shared libraries: libonig.so.4: cannot open shared object file: No such file or directory


php: error while loading shared libraries: libonig.so.4: cannot open shared object file: No such file or directory

宝塔环境安装php8.0时出现如下
php: error while loading shared libraries: libonig.so.4: cannot open shared object file: No such file or directory

然后在安装php时怎么都无法启动。

应该时缺少libonig依赖库。那么就安装一下即可。我用的时Debian10,如果你时ubuntu一样适用。

SSH安装libonig:

apt-get install libonig-dev -y
然后又报错了:

You might want to run ‘apt —fix-broken install’ to correct these.
The following packages have unmet dependencies:
bt-nginx120 : Depends: liblua5.1-0 but it is not going to be installed
bt-php80 : Depends: libonig5 (>= 6.8.1) but it is not going to be installed
Depends: libsodium23 (>= 1.0.14) but it is not going to be installed
libonig-dev : Depends: libonig5 (= 6.9.1-1) but it is not going to be installed
E: Unmet dependencies. Try ‘apt —fix-broken install’ with no packages (or specify a solution).
问题不大,按指导修复:

apt --fix-broken install
一顿操作后,修复完成。自动配置软件。

Setting up libsodium23:amd64 (1.0.17-1) …
Setting up liblua5.1-0:amd64 (5.1.5-8.1+b2) …
Setting up libonig5:amd64 (6.9.1-1) …
Setting up bt-nginx120 (1.20.0) …
Setting up bt-php80 (8.0.6) …
Processing triggers for libc-bin (2.28-10) …
此时问题就已经修复了。去宝塔面板重启下php8.0即可。

1

【解决方案php:error while loading shared libraries: libonig.so.4: cannot open shared object file: No such file or directory隶属于分类: php

它起初由本站用户:未命名于2年前 创建。

该内容的链接是:

目录