This error is reported when installing and starting nginx today: error while loading shared libraries: libgd. So. 2: cannot open shared object. I checked the relevant information on the Internet and solved it. This record also allows friends who encounter this problem to solve it quickly.
First, let’s talk about the solution to help those who are anxious to solve the problem. This is because the
GD library is missing. Just install it. Installation method: 1. It is easiest to directly
Yum install GD . 2. If Yum can’t search the installation package of
GD library, you can manually download the corresponding RPM package at: http://rpmfind.net/linux/rpm2html/search.php?query=libgd.so.2 Install after downloading.
After installation, start nginx normally.
Let’s talk about the troubleshooting steps. You can refer to this method to solve similar problems in the future.
According to the error prompt, the libgd. So. 2 class library file failed to load. In this case, either lib is not installed or the installation location is not in the correct location. Check the class library files that nginx depends on through the LDD command:
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)
This is not found, libgd. So. 2 = & gt; not found
A search on the Internet shows that this library comes with the GD installation package. If you confirm that GD has been installed, then this library is on the system. Find this file through the find command
After finding it, you can copy it to the corresponding lib directory. If not, you can only reinstall it. How do we know the name of the package to be installed?Very simple. You can baidu search libgd. So. 2 to find out which installation package the library file comes from. Or you can check this website, http://rpmfind.net/linux/rpm2html/search.php?query=libgd.so.2 , it is found that this class library is from the GD installation package
Yum search GD search. If yes, you can directly
Yum install GD
It’s OK. If not, you can also find the installation package that conforms to your own system through the website above (mainly depending on the operating system version number, 32-bit or 64 bit, and the new version is 64 bit), download it, and then install it through the corresponding command. Other class library files are missing, and the solution is similar.
- Error occurs when configuring nginx installation information. / configure: error: the HTTP rewrite module requires the PCRE library. You can
- Support annot run git xcrun: error: invalid active developer path
- [Solved] Incompatibile SockJS! Main site uses: “1.5.0”, the iframe: “1.0.0”. at s (VM6 sockjs.min.js:2) version issue
- Nginx installation in MAC
- Error！ Failed to start nginx
- Nginx error: nginx: [error] invalid PID number “” in “/run/nginx.pid”
- nginx: [error] invalid PID number in /var/run/nginx.pid
- E: sub process / usr / bin / dpkg returned an error code (2) solution under Ubuntu
- Talking about the errors encountered in installing MySQL ODBC (error 1918)
- No module named numpy error in Python code
- Record of solving the failure of installing ie11 (9c59) under 64 bit Windows 7 system
- The simplest way to configure OpenGL development environment with vs2015
- Error in loadNamespace(name) : there is no package called ‘yaml’
- Solve the problem of prompt couldn’t find path to unrear library after installing unrear in Python
- Nginx startup error: nginx: [error] open() “/ var / run / nginx/ nginx.pid The solution of “failed (2: no such file or directory)”
- Installation library on pychar (taking pandas for example)
- How to Use Apt get Command Under Mac OSX
- Resolve nginx startup failure
- The garbled problem of hot deployment in nginx
- python: This application failed to stat could not find or load the Qt platform plugin “windows”