Can’t load ‘/usr/local/lib64/perl5/auto/nginx/nginx.so’

While working on Nginx installation from source, I got the following error when I try to run nginx after compilation –
[root@localhost nginx-1.6.0]# /usr/sbin/nginx
Can’t load ‘/usr/local/lib64/perl5/auto/nginx/nginx.so’ for module nginx: /usr/local/lib64/perl5/auto/nginx/nginx.so: undefined symbol: ngx_http_perl_handle_request at /usr/share/perl5/XSLoader.pm line 68.
at /usr/local/lib64/perl5/nginx.pm line 56.
Compilation failed in require.
BEGIN failed–compilation aborted.
nginx: [alert] perl_parse() failed: 255
[root@localhost nginx-1.6.0]#

The problem occur when I was trying to install the nginx 1.6.0 version on CentOS 7.
It was nginx perl module ,I was enabling while compling.

As per Nginx ./configure --help

--with-http_perl_module            enable ngx_http_perl_module

Solution: To solve this problem use the below given additional option with configure script (i.e --with-ld-opt="-Wl,-E")

./configure --with-http_perl_module --with-ld-opt="-Wl,-E"

And then use below given command for further installation

make && make install

7 thoughts on “Can’t load ‘/usr/local/lib64/perl5/auto/nginx/nginx.so’”

  1. I have nginx compiled with the same options but still I am getting the “undefined symbol” error on my centos7 server

    any pointers
    Can’t load ‘/usr/lib64/perl5/lib/perl5/x86_64-linux-thread-multi/auto/Nginx/Nginx.so’ for module Nginx: /usr/lib64/perl5/lib/perl5/x86_64-linux-thread-multi/auto/Nginx/Nginx.so: undefined symbol: ngx_http_perl_handle_request at /usr/share/perl5/XSLoader.pm line 68.
    at /usr/lib64/perl5/lib/perl5/x86_64-linux-thread-multi/Nginx.pm line 110.
    Compilation failed in require at /usr/local/share/perl5/Nginx/Redis.pm line 15.
    BEGIN failed–compilation aborted at /usr/local/share/perl5/Nginx/Redis.pm line 15.
    Compilation failed in require at Trigger.pm line 6.
    BEGIN failed–compilation aborted at Trigger.pm line 6.
    You have new mail in /var/spool/mail/root

    Reply
    • Hi Ramprasad,

      Which Nginx version are you installing.
      The error is showing on “/usr/local/share/perl5/Nginx/Redis.pm” , do you need redis module ?

      I appreciate if you could provide the all commands which you are using for installing Nginx.

      Regards
      Sharad

      Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.