如果启动nginx报错:

正在启动 nginx:Can't locate nginx.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .).
BEGIN failed--compilation aborted.
nginx: [alert] perl_parse() failed: 2
                                                           [失败]

这是因为没有make install,导致http_perl_module加载异常,需要将以下文件复制到指定目录

mkdir -p /usr/local/lib64/perl5/auto/nginx
cp objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.bs objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.so /usr/local/lib64/perl5/auto/nginx/
cp objs/src/http/modules/perl/blib/lib/nginx.pm /usr/local/lib64/perl5/

然后重新启动nginx

相关文章:

  • 2021-09-27
  • 2022-12-23
  • 2021-11-30
  • 2022-01-26
  • 2021-08-02
  • 2022-12-23
  • 2022-12-23
  • 2021-09-18
猜你喜欢
  • 2022-12-23
  • 2021-08-02
  • 2021-08-04
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案