今天宝塔下安装php 报错
/www/server/php/56/sbin/php-fpm: error while loading shared libraries: libcares.so.2: cannot open shared object file: No such file or directory
自己摸索解决
[root@10-9-144-239 ~]# find / -name libcares.so.2
[root@10-9-144-239 ~]# yum search cares
Loaded plugins: fastestmirror, langpacks, versionlock
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
Excluding 1 update due to versionlock (use "yum versionlock status" to show it)
Warning: No matches found for: cares
No matches found
[root@10-9-144-239 ~]# yum search c-ares
Loaded plugins: fastestmirror, langpacks, versionlock
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
Excluding 1 update due to versionlock (use "yum versionlock status" to show it)
=================================================================== N/S matched: c-ares ===================================================================
c-ares-devel.i686 : Development files for c-ares
c-ares-devel.x86_64 : Development files for c-ares
c-ares.i686 : A library that performs asynchronous DNS operations
c-ares.x86_64 : A library that performs asynchronous DNS operations
Name and summary matches only, use "search all" for everything.
[root@10-9-144-239 ~]# yum install c-ares-devel.x86_64
Loaded plugins: fastestmirror, langpacks, versionlock
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
Excluding 1 update due to versionlock (use "yum versionlock status" to show it)
Resolving Dependencies
--> Running transaction check
---> Package c-ares-devel.x86_64 0:1.10.0-3.el7 will be installed
--> Processing Dependency: c-ares = 1.10.0-3.el7 for package: c-ares-devel-1.10.0-3.el7.x86_64
--> Processing Dependency: libcares.so.2()(64bit) for package: c-ares-devel-1.10.0-3.el7.x86_64
--> Running transaction check
---> Package c-ares.x86_64 0:1.10.0-3.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
===========================================================================================================================================================
Package Arch Version Repository Size
===========================================================================================================================================================
Installing:
c-ares-devel x86_64 1.10.0-3.el7 base 72 k
Installing for dependencies:
c-ares x86_64 1.10.0-3.el7 base 78 k
Transaction Summary
===========================================================================================================================================================
Install 1 Package (+1 Dependent package)
Total download size: 150 k
Installed size: 262 k
Is this ok [y/d/N]: y
Downloading packages:
(1/2): c-ares-1.10.0-3.el7.x86_64.rpm | 78 kB 00:00:00
(2/2): c-ares-devel-1.10.0-3.el7.x86_64.rpm | 72 kB 00:00:00
-----------------------------------------------------------------------------------------------------------------------------------------------------------
Total 729 kB/s | 150 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
** Found 11 pre-existing rpmdb problem(s), 'yum check' output follows:
bt-curl-7.54.0-1.el7.centos.x86_64 has missing requires of libcares.so.2()(64bit)
bt-curl-7.70.0-1.el7.x86_64 is a duplicate with bt-curl-7.54.0-1.el7.centos.x86_64
bt-libiconv-1.14-1.el7.centos.x86_64 has missing requires of libcharset.so.1()(64bit)
bt-libiconv-1.14-1.el7.centos.x86_64 has missing requires of libiconv.so.2()(64bit)
bt-php-5.6.30-1.el7.centos.x86_64 has missing requires of libcares.so.2()(64bit)
bt-php-5.6.30-1.el7.centos.x86_64 has missing requires of libiconv
bt-php-5.6.30-1.el7.centos.x86_64 has missing requires of libmcrypt
bt-php-5.6.30-1.el7.centos.x86_64 has missing requires of mcrypt
bt-php-5.6.30-1.el7.centos.x86_64 has missing requires of mhash
2:postfix-2.10.1-7.0.1.el7.centos.x86_64 has missing requires of libmysqlclient.so.18()(64bit)
2:postfix-2.10.1-7.0.1.el7.centos.x86_64 has missing requires of libmysqlclient.so.18(libmysqlclient_18)(64bit)
Installing : c-ares-1.10.0-3.el7.x86_64 1/2
Installing : c-ares-devel-1.10.0-3.el7.x86_64 2/2
Verifying : c-ares-devel-1.10.0-3.el7.x86_64 1/2
Verifying : c-ares-1.10.0-3.el7.x86_64 2/2
Installed:
c-ares-devel.x86_64 0:1.10.0-3.el7
Dependency Installed:
c-ares.x86_64 0:1.10.0-3.el7
Complete!
[root@10-9-144-239 ~]# php -v
PHP 5.6.30 (cli) (built: Jun 5 2017 17:34:00)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend Guard Loader v3.3, Copyright (c) 1998-2014, by Zend Technologies