解决软件启动报error while loading shared libraries: libgd.so.2: cannot open shared object错误
解决软件启动报error while loading shared libraries: libgd.so.2: cannot open shared object错误
今天安装启动nginx的时候报这个错误:error while loading shared libraries: libgd.so.2: cannot open shared object,网上查了相关资料,解决了,在此记录下,也让后面遇到这个问题的朋友能快速解决。
先说解决办法,帮助着急解决问题的朋友,这个是因为缺失gd库,把他装上就可以了。 安装办法: 1、直接yum install gd 最简单 2、如果yum搜索不到gd库的安装包,可以手动下载对应rpm包,下载地址:http://rpmfind.net/linux/rpm2html/search.php?query=libgd.so.2下载完了之后安装即可。
安装完成之后,再启动nginx正常。
再来说问题排查步骤,后续遇到类似问题可以参考这个方法解决。
根据报错提示,是libgd.so.2类库文件加载失败。这种情况要么对应lib没有安装,要么安装位置没到正确位置。通过ldd命令查一下nginx依赖的类库文件:
- ldd /usr/local/nginx/sbin/nginx
- linux-vdso.so.1 => (0x00007fffd5fb6000)
- libpthread.so.0 => /lib64/libpthread.so.0 (0x000000379e200000)
- libcrypt.so.1 => /lib64/libcrypt.so.1 (0x000000393f200000)
- libpcre.so.0 => /lib64/libpcre.so.0 (0x00000033d5800000)
- libssl.so.10 => /usr/lib64/libssl.so.10 (0x0000003c60200000)
- libcrypto.so.10 => /usr/lib64/libcrypto.so.10 (0x0000003df9800000)
- libdl.so.2 => /lib64/libdl.so.2 (0x000000390be00000)
- libz.so.1 => /lib64/libz.so.1 (0x0000003a25600000)
- libc.so.6 => /lib64/libc.so.6 (0x0000003a24200000)
- libgd.so.2 => not found
- /lib64/ld-linux-x86-64.so.2 (0x0000003a23e00000)
- libfreebl3.so => /lib64/libfreebl3.so (0x000000393ea00000)
- libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x000000379fa00000)
- libkrb5.so.3 => /lib64/libkrb5.so.3 (0x000000379d200000)
- libcom_err.so.2 => /lib64/libcom_err.so.2 (0x000000379e600000)
- libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x0000003df9c00000)
- libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x0000003dfa800000)
- libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x0000003dfa400000)
- libresolv.so.2 => /lib64/libresolv.so.2 (0x0000003a26a00000)
- libselinux.so.1 => /lib64/libselinux.so.1 (0x0000003df7c00000)
发现这个找不到, libgd.so.2 => not found
网上一搜,这个库是gd安装包带的,如果确认安装过gd,那么这个库是在系统上的,通过find命令找到这个文件
find / -name 'libgd.so.2'
找到之后,可以复制一份到对应lib目录,如果没有,那只能重新安装了,我们怎么知道要安装包的名字呢?很简单,你可以百度搜一下这个libgd.so.2,就能查到这个库文件是来自哪个安装包。 或者你可以到这个网站查,http://rpmfind.net/linux/rpm2html/search.php?query=libgd.so.2,查到这个类库来自GD安装包
先
yum search gd 搜一下,如果有,那就直接 yum install gd
就可以了,没有的话也可以通过上面那个网站,找到符合自己系统的安装包(主要靠操作系统版本号,还有事32还是64位的,新版本的都是64位了),下载下来,然后通过对应命令安装就可以了。其它类库文件缺失解决办法类似。
文章首发: https://www.geek-share.com/detail/2750257208.html
参考文章:
解决软件启动报error while loading shared libraries: libgd.so.2: cannot open shared object错误的更多相关文章
- linux安装MySQL报 error while loading shared libraries: libtinfo.so.5 解决办法
MySQL服务启动报错 error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No ...
- 报错libtest: error while loading shared libraries: libuv.so.1: cannot open shared object file: No such file or directory
使用g++编译.运行libuv的demo错误解决 我们通过例子来讲述监视器的使用. 例子中空转监视器回调函数被不断地重复调用, 通过例子我们也可以了解到: 由于设置了监视器, 所以调用 uv_run ...
- 报错:/application/zabbix/sbin/zabbix_server: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
启动zabbix_server时报错: /application/zabbix/sbin/zabbix_server: error while loading shared libraries: li ...
- 启动MongoDB时,提示:error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
启动MongoDB时,提示: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: ...
- 使用arm-none-eabi-gdb报错error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
使用arm-none-eabi-gdb报错error while loading shared libraries: libncurses.so.5: cannot open shared objec ...
- 错误解决:error while loading shared libraries: libcurl.so.4: cannot open shared object file: No such file or directory
执行以下代码,生成唯一的UID $fp = popen("/xxx/bin/tools/uuidgen system", "r");// $uid = frea ...
- Nginx启动出错 error while loading shared libraries:
在centos5.7 32位上编译安照 nginx-1.1.16 出错 [root@localhost conf]# /usr/local/nginx/sbin/nginx/usr/local/ngi ...
- (转)Nginx启动出错 error while loading shared libraries
[root@localhost conf]# /usr/local/nginx/sbin/nginx/usr/local/nginx/sbin/nginx: error while loading s ...
- nginx检查报错 error while loading shared libraries: libprofiler.so.0: cannot open shared object file: No such file or directory
在centos7.3上编译安装nginx-1.12.2 启动测试出错 [root@web02 local]# /usr/local/nginx/sbin/nginx -t /usr/local/ngi ...
随机推荐
- tr标签是什么
<tr> 标签定义 HTML 表格中的行. tr 元素包含一个或多个 th 或 td 元素.
- 一点一点学写Makefile(3)-增加第三方库和头文件
我们在写代码的时候不一定都是有自己来完成,一个工程中会大量使用一些比较优秀的动态库.静态库等,我们在使用这些库完成所有的代码后,需要在编译的时候将这些库使用的头文件添加到我们的工程上,将他的库文件也添 ...
- Android(java)学习笔记32:Android布局详解之一:FrameLayout
1. FrameLayout是最简单的布局了.所有放在布局里的控件,都按照层次堆叠在屏幕的左上角.后加进来的控件覆盖前面的控件. 在FrameLayout布局里,定义任何空间的位置相关的属性都毫无意义 ...
- bzoj 3028 生成函数
计算完后为 f(x): 根据我翻高数书,终于推倒出来了. (- ̄▽ ̄)-
- LA 2038 最少点覆盖
题目链接:https://vjudge.net/problem/UVALive-2038 题意:我看了原题,lrj的书上题意写错了,应该是最少点覆盖,当然可以用最大匹配去做,由于是树形的: 可以树形D ...
- MVC学习二:Controller和View关系
控制器(Controller)主要是定义方法和加载视图(View) 1.控制器中的Action方法返回值的类型ActionResult,string 2.控制器中Action方法接收浏览器参数方式: ...
- hive中使用rcfile
(1)建student & student1 表:(hive 托管)create table student(id INT, age INT, name STRING)partitioned ...
- 01_常用 Linux 命令的基本使用
01. 学习 Linux 终端命令的原因 Linux 刚面世时并没有图形界面,所有的操作全靠命令完成,如 磁盘操作.文件存取.目录操作.进程管理.文件权限 设定等 在职场中,大量的 服务器维护工作 都 ...
- Code First 一
Code-First和我们的数据库优先方式是相反的,数据库优先是通过数据库映射出相应的类和上下文,Code-First测试通过创建的类和上下文得到相应的数据库. Code-First主要用于领域驱动设 ...
- data-ng-show指令
<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content=&q ...