Perl and Apache

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rois
    New Member
    • Oct 2008
    • 3

    Perl and Apache

    I have a perl script that runs perfectly when i run from the command prompt.
    When I execute via apache2 it does NOT run because it cannot locate region.pm which i need for the script. region.pm is in the same folder as the script.
    when i remove it it works.
    It also works when i include "use lib 'script_folder' ;" !

    I believe it has to do with apache and paths.
    The apache error log gives message "Can't locate region.pm in @INC".
    I have added the path to @INC but still doesn't work!

    Any Ideas?????
  • numberwhun
    Recognized Expert Moderator Specialist
    • May 2007
    • 3467

    #2
    Do you add the directory where the script is located into your @INC?

    @INC contains the list of directories where Perl will look for installed modules. If you have your own, then you are going to have to add, in your script, the directory where your perl module is being kept.

    Here is a link that shows you what I am talking about.

    Regards,

    Jeff

    Comment

    • rois
      New Member
      • Oct 2008
      • 3

      #3
      Thanks Jef

      /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/ 5.8.7/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-m ulti /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/site_ perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/li b/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8. 8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.7/i386-linux-thread-mul ti /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/vendo r_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/p erl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_pe rl/5.8.5 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 . /data1/flystaydrive/rois

      here are paths in @INC and the last one /data1/flystaydrive/rois is the path where both the perl script and region.pm are located

      Comment

      • numberwhun
        Recognized Expert Moderator Specialist
        • May 2007
        • 3467

        #4
        If it is in the @INC path, then you need to make sure that other factors, like permissions on that directory or the modules are not keeping you from accessing them.

        Regards,

        Jeff

        Comment

        • KevinADC
          Recognized Expert Specialist
          • Jan 2007
          • 4092

          #5
          see post below

          Comment

          • KevinADC
            Recognized Expert Specialist
            • Jan 2007
            • 4092

            #6
            I think the problem is that the "lib" folder is outside of the apache folder. Not sure if Apache will include a folder from just anywhere on the hard drive. Move the folder and the script into the apache folder and retry.

            Comment

            • rois
              New Member
              • Oct 2008
              • 3

              #7
              Originally posted by KevinADC
              I think the problem is that the "lib" folder is outside of the apache folder. Not sure if Apache will include a folder from just anywhere on the hard drive. Move the folder and the script into the apache folder and retry.
              I believe that the problem lies with apache and not perl! I have another linux server and I have tried it and it works as it is! I will try and reinstall apache.

              Comment

              Working...