Cannot load cgi-library into perl-cgi-script












1















I'm trying to run a perlscript as a cgi-Script. However including the cgi-library of perl doesn't work:



# perl -e 'use CGI::Carp qw(fatalsToBrowser);'
Can't locate CGI/Carp.pm in @INC (you may need to install the CGI::Carp module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
#


On an old server the same command does not produce an error message and cgi scripts run properly.



This seems to be a perl-problem, not an Apache problem.



On my servcer Carp.pm is already installed in one of the paths given in @INC:



# find /usr -iname 'Carp.pm' -ls
555093613 20 -rw-r--r-- 1 root root 20074 Aug 24 21:47 /usr/lib/x86_64-linux-gnu/perl-base/Carp.pm
382731053 20 -rw-r--r-- 1 root root 20074 Mär 13 2016 /usr/share/perl/5.22.1/Carp.pm
#


How do I get the cgi-Library included. I'm using Ubuntu 16.04 LTS.










share|improve this question





























    1















    I'm trying to run a perlscript as a cgi-Script. However including the cgi-library of perl doesn't work:



    # perl -e 'use CGI::Carp qw(fatalsToBrowser);'
    Can't locate CGI/Carp.pm in @INC (you may need to install the CGI::Carp module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at -e line 1.
    BEGIN failed--compilation aborted at -e line 1.
    #


    On an old server the same command does not produce an error message and cgi scripts run properly.



    This seems to be a perl-problem, not an Apache problem.



    On my servcer Carp.pm is already installed in one of the paths given in @INC:



    # find /usr -iname 'Carp.pm' -ls
    555093613 20 -rw-r--r-- 1 root root 20074 Aug 24 21:47 /usr/lib/x86_64-linux-gnu/perl-base/Carp.pm
    382731053 20 -rw-r--r-- 1 root root 20074 Mär 13 2016 /usr/share/perl/5.22.1/Carp.pm
    #


    How do I get the cgi-Library included. I'm using Ubuntu 16.04 LTS.










    share|improve this question



























      1












      1








      1








      I'm trying to run a perlscript as a cgi-Script. However including the cgi-library of perl doesn't work:



      # perl -e 'use CGI::Carp qw(fatalsToBrowser);'
      Can't locate CGI/Carp.pm in @INC (you may need to install the CGI::Carp module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at -e line 1.
      BEGIN failed--compilation aborted at -e line 1.
      #


      On an old server the same command does not produce an error message and cgi scripts run properly.



      This seems to be a perl-problem, not an Apache problem.



      On my servcer Carp.pm is already installed in one of the paths given in @INC:



      # find /usr -iname 'Carp.pm' -ls
      555093613 20 -rw-r--r-- 1 root root 20074 Aug 24 21:47 /usr/lib/x86_64-linux-gnu/perl-base/Carp.pm
      382731053 20 -rw-r--r-- 1 root root 20074 Mär 13 2016 /usr/share/perl/5.22.1/Carp.pm
      #


      How do I get the cgi-Library included. I'm using Ubuntu 16.04 LTS.










      share|improve this question
















      I'm trying to run a perlscript as a cgi-Script. However including the cgi-library of perl doesn't work:



      # perl -e 'use CGI::Carp qw(fatalsToBrowser);'
      Can't locate CGI/Carp.pm in @INC (you may need to install the CGI::Carp module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at -e line 1.
      BEGIN failed--compilation aborted at -e line 1.
      #


      On an old server the same command does not produce an error message and cgi scripts run properly.



      This seems to be a perl-problem, not an Apache problem.



      On my servcer Carp.pm is already installed in one of the paths given in @INC:



      # find /usr -iname 'Carp.pm' -ls
      555093613 20 -rw-r--r-- 1 root root 20074 Aug 24 21:47 /usr/lib/x86_64-linux-gnu/perl-base/Carp.pm
      382731053 20 -rw-r--r-- 1 root root 20074 Mär 13 2016 /usr/share/perl/5.22.1/Carp.pm
      #


      How do I get the cgi-Library included. I'm using Ubuntu 16.04 LTS.







      apache2 perl






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 26 '17 at 19:10









      Doug Smythies

      7,17631428




      7,17631428










      asked Aug 26 '17 at 19:02









      linuxbasherlinuxbasher

      612




      612






















          2 Answers
          2






          active

          oldest

          votes


















          2














          Partially answering this for my own archiving. This seems to be a recent error that stems from a broken dependency. I got a similar error message when check the error log.



          tail -100 /var/log/apache2/error.log
          ...
          AH01215: Can't locate CGI.pm in @INC (you may need to install the CGI module)
          ...


          After some detective work, I traced this to the following dependency (sorry I lost my source).



          sudo apt-get install libcgi-session-perl





          share|improve this answer
























          • I very much appreciate this I had this error right on a webpage on the server I was running. "Can't locate CGI.pm in @INC (you may need to install the CGI module)" This indeed fixed it

            – BrianBlaze
            Oct 17 '18 at 17:44



















          0














          In my case, this problem was caused by incorrect file and directory permissions within the various system perl5/ directories. The files need to be readable by the user under which the webserver is running. The program files (.pl) need to be executable. The directories need to be readable and searchable.






          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "89"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f950113%2fcannot-load-cgi-library-into-perl-cgi-script%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            2














            Partially answering this for my own archiving. This seems to be a recent error that stems from a broken dependency. I got a similar error message when check the error log.



            tail -100 /var/log/apache2/error.log
            ...
            AH01215: Can't locate CGI.pm in @INC (you may need to install the CGI module)
            ...


            After some detective work, I traced this to the following dependency (sorry I lost my source).



            sudo apt-get install libcgi-session-perl





            share|improve this answer
























            • I very much appreciate this I had this error right on a webpage on the server I was running. "Can't locate CGI.pm in @INC (you may need to install the CGI module)" This indeed fixed it

              – BrianBlaze
              Oct 17 '18 at 17:44
















            2














            Partially answering this for my own archiving. This seems to be a recent error that stems from a broken dependency. I got a similar error message when check the error log.



            tail -100 /var/log/apache2/error.log
            ...
            AH01215: Can't locate CGI.pm in @INC (you may need to install the CGI module)
            ...


            After some detective work, I traced this to the following dependency (sorry I lost my source).



            sudo apt-get install libcgi-session-perl





            share|improve this answer
























            • I very much appreciate this I had this error right on a webpage on the server I was running. "Can't locate CGI.pm in @INC (you may need to install the CGI module)" This indeed fixed it

              – BrianBlaze
              Oct 17 '18 at 17:44














            2












            2








            2







            Partially answering this for my own archiving. This seems to be a recent error that stems from a broken dependency. I got a similar error message when check the error log.



            tail -100 /var/log/apache2/error.log
            ...
            AH01215: Can't locate CGI.pm in @INC (you may need to install the CGI module)
            ...


            After some detective work, I traced this to the following dependency (sorry I lost my source).



            sudo apt-get install libcgi-session-perl





            share|improve this answer













            Partially answering this for my own archiving. This seems to be a recent error that stems from a broken dependency. I got a similar error message when check the error log.



            tail -100 /var/log/apache2/error.log
            ...
            AH01215: Can't locate CGI.pm in @INC (you may need to install the CGI module)
            ...


            After some detective work, I traced this to the following dependency (sorry I lost my source).



            sudo apt-get install libcgi-session-perl






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Sep 12 '17 at 16:20









            AlaskaJoslinAlaskaJoslin

            1213




            1213













            • I very much appreciate this I had this error right on a webpage on the server I was running. "Can't locate CGI.pm in @INC (you may need to install the CGI module)" This indeed fixed it

              – BrianBlaze
              Oct 17 '18 at 17:44



















            • I very much appreciate this I had this error right on a webpage on the server I was running. "Can't locate CGI.pm in @INC (you may need to install the CGI module)" This indeed fixed it

              – BrianBlaze
              Oct 17 '18 at 17:44

















            I very much appreciate this I had this error right on a webpage on the server I was running. "Can't locate CGI.pm in @INC (you may need to install the CGI module)" This indeed fixed it

            – BrianBlaze
            Oct 17 '18 at 17:44





            I very much appreciate this I had this error right on a webpage on the server I was running. "Can't locate CGI.pm in @INC (you may need to install the CGI module)" This indeed fixed it

            – BrianBlaze
            Oct 17 '18 at 17:44













            0














            In my case, this problem was caused by incorrect file and directory permissions within the various system perl5/ directories. The files need to be readable by the user under which the webserver is running. The program files (.pl) need to be executable. The directories need to be readable and searchable.






            share|improve this answer




























              0














              In my case, this problem was caused by incorrect file and directory permissions within the various system perl5/ directories. The files need to be readable by the user under which the webserver is running. The program files (.pl) need to be executable. The directories need to be readable and searchable.






              share|improve this answer


























                0












                0








                0







                In my case, this problem was caused by incorrect file and directory permissions within the various system perl5/ directories. The files need to be readable by the user under which the webserver is running. The program files (.pl) need to be executable. The directories need to be readable and searchable.






                share|improve this answer













                In my case, this problem was caused by incorrect file and directory permissions within the various system perl5/ directories. The files need to be readable by the user under which the webserver is running. The program files (.pl) need to be executable. The directories need to be readable and searchable.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 11 at 16:21









                JAMJAM

                1




                1






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Ask Ubuntu!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f950113%2fcannot-load-cgi-library-into-perl-cgi-script%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

                    is 'sed' thread safe

                    How to make a Squid Proxy server?