0

I have nginx version 1.10.2 running on a CentOS 7 box. When I try to start the service I am getting the following error:

Aug 15 16:08:50 user.mylabserver.com nginx[2704]: 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/vend
Aug 15 16:08:50 user.mylabserver.com nginx[2704]: BEGIN failed--compilation 
aborted.
Aug 15 16:08:50 user.mylabserver.com nginx[2704]: nginx: [alert] 
perl_parse() failed: 2
Aug 15 16:08:50 user.mylabserver.com systemd[1]: nginx.service: main process 
exited, code=exited, status=1/FAILURE
Aug 15 16:08:50 user.mylabserver.com systemd[1]: Unit nginx.service entered 
failed state.
Aug 15 16:08:50 user.mylabserver.com systemd[1]: nginx.service failed.
4

The relevant portion of the log is:

Aug 15 16:08:50 user.mylabserver.com nginx[2704]: 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/vend

The first line indicates that the service startup is failing because it cannot locate the file nginx.pm.

The remainder indicates with specificity the exact locations in which is it seeking that file.

If that file does not exist in any of those directories, it appears that either a component of the service has been (re)moved

If it does exist, it is likely that you are not starting the service with a user who has permissions to see or read the required file.

  • 1
    Yes, it turned out that I was starting the service with the nginx user and the nginx.pm file has root ownership. Silly mistake. Thanks for your help! – N.M.D Aug 15 '17 at 18:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.