I've built nginx on my target machine (Linux) with a 3rd party module (ngx_mongo). This module required two additional libraries to be present: pcre and yajl. I built and installed these two separately and they installed to /usr/local/lib and headers to /usr/local/include.
I then configured nginx's build: configure --add-module=/home/greg.zoller/working/ngx_mongo This found all the needed libs and successfully built w/o errors. Installed nginx to default /usr/local/nginx.
When I go to run /usr/local/nginx/sbin/nginx I get this error:
./nginx: error while loading shared libraries: libyajl.so.2: cannot open shared object file: No such file or directory
Why can't it find libyajl.so.2? This file exists in /usr/local/lib and the build found it.
I ran ldconfig -v and the yajl library was not there. I tried running (as root and not) just ldconfig. No change.
What am I missing?
The dynamic loader only looks for libs present in folders declared in /etc/ld.so.conf
. /usr/local/lib
may not be there by default. Also when a new lib is added, you need to run ldconfig
since the contents of lib folders are cached.