openresty / replace-filter-nginx-module

Streaming regular expression replacement in response bodies
260 stars 67 forks source link

Error while installing #6

Closed deepesh-agarwal closed 11 years ago

deepesh-agarwal commented 11 years ago

I am getting this error while trying to compile latest Nginx with this module :

/home/ec2-user/replace-filter-nginx-module/src/ngx_http_replace_script.c: In function ângx_http_replace_script_copy_capture_codeâ:
/home/ec2-user/replace-filter-nginx-module/src/ngx_http_replace_script.c:466:47: error: variable âposâ set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors
make[1]: *** [objs/addon/src/ngx_http_replace_script.o] Error 1
make[1]: Leaving directory `/home/ec2-user/nginx-1.5.1'
make: *** [build] Error 2```
deepesh-agarwal commented 11 years ago

Using ./configure --add-module=/home/ec2-user/replace-filter-nginx-module --with-cc-opt=-Wno-error worked and nginx installed, but when trying to run ./nginx it complains ./nginx: error while loading shared libraries: libsregex.so.0: cannot open shared object file: No such file or directory

I know this is a missing library issue, but I did make install for the sregx with sucess

sudo make install ==== Installing sregex 0.0.1 to /usr/local ==== mkdir -p /usr/local/include/sregex /usr/local/lib /usr/local/bin install -m 0755 sregex-cli /usr/local/bin/sregex-cli install -m 0644 src/sregex/sregex.h src/sregex/ddebug.h /usr/local/include/sregex install -m 0755 libsregex.so /usr/local/lib/libsregex.so.0.0.1 ldconfig -n /usr/local/lib ln -sf libsregex.so.0.0.1 /usr/local/lib/libsregex.so ln -sf libsregex.so.0.0.1 /usr/local/lib/libsregex.so.0 ==== Successfully installed sregex 0.0.1 to /usr/local ====

agentzh commented 11 years ago

Thank you for the report! I've just fixed the gcc warning "variable 'pos' set but not used" in git master.

For the libsregex.so.0 loading error, you can

  1. specify the option --with-ld-opt="-Wl,-rpath,/usr/local/lib" when building nginx, that is,

    ./configure --add-module=/home/ec2-user/replace-filter-nginx-module \ --with-ld-opt="-Wl,-rpath,/usr/local/lib"

    or

  2. just specify the LD_LIBRARY_PATH when starting the nginx server, that is,

    LD_LIBRARY_PATH=/usr/local/lib /path/to/your/nginx ...

The 1st approach is preferred though.

Best regards, -agentzh

mtx-z commented 7 years ago

Hello, i have the same probleme. The --with-ld-opt="-Wl,-rpath,/usr/local/lib" has been used in configure. I tried the "LD_LIBRARY_PATH=/usr/local/lib" before starting nginx but still same...

root@server:~# locate libsregex.so.0
/installers/sregex/sregex/libsregex.so.0
/usr/local/lib/libsregex.so.0
/usr/local/lib/libsregex.so.0.0.1

Anything i missed ? Thanks.

agentzh commented 7 years ago

@mtx-z Please do not reply to a closed issue. Better create a new one. Thank you. Also, please provide as many details as possible when you report a problem. Simply saying "the same problem" is not helpful at all. Who knows what part of the original problem you are sharing on your side? Not to mention the original reporter of this issue has already resolved his problems.