宝塔安装 PHP 报错 : libcares.so.2: cannot open shared object file: No such file or directory

发布时间: 2023-10-10 热度: 3597

系统环境 debian或者ubuntu ,宝塔或者mw

直接说解决办法:安装 apt install libc-ares2 ,然后再去宝塔安装就OK了。

下面是解决问题时的过程

报错信息是这样的:

failed to activate:

/www/server/php/72/sbin/php-fpm: error while loading shared libraries: libcares.so.2: cannot open shared object file: No such file or directory

安装 libc-ares2,执行

apt install libc-ares2

然后再去宝塔安装PHP就可以了。

如果你还是安装不上的话,换成下面这个源再试试:

deb http://mirrors.ustc.edu.cn/debian/ buster main
deb-src http://mirrors.ustc.edu.cn/debian/ buster main

deb http://security.debian.org/debian-security buster/updates main
deb-src http://security.debian.org/debian-security buster/updates main

# buster-updates, previously known as 'volatile'
deb http://mirrors.ustc.edu.cn/debian/ buster-updates main
deb-src http://mirrors.ustc.edu.cn/debian/ buster-updates main

deb http://mirrors.ustc.edu.cn/debian/ buster-backports main non-free contrib
deb-src http://mirrors.ustc.edu.cn/debian/ buster-backports main non-free contrib

deb http://mirrors.aliyun.com/debian/ stretch main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ stretch main non-free contrib
deb http://mirrors.aliyun.com/debian-security stretch/updates main
deb-src http://mirrors.aliyun.com/debian-security stretch/updates main
deb http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib

请在下方留下您的评论.加入TG吹水群