nginx: error while loading shared libraries: libgd.so.2: cannot open shared object错误

根据报错提示,是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'

yum search gd 搜一下,如果有,那就直接 yum install gd

© 版权声明
THE END
喜欢大叔奶茶源码就支持一下吧
点赞7 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容