Can't load /usr/local/lib64/perl5/auto/nginx/nginx.so
时间:2019-08-20 17:58:06 来源:igfitidea点击:
在CentOS 7上通过源代码安装Nginx 1.6.0,编译后运行Nginx时遇到以下错误:
[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]#
在编译时通过下面命令 --with-http_perl_module enable ngx_http_perl_module
指定了安装nginx perl模块。
解决方案
要解决此问题,需要添加额外的选项 (--with-ld-opt="-Wl,-E"
)
./configure --with-http_perl_module --with-ld-opt="-Wl,-E"
重新编译安装:
make && make install