467,109 Members | 1,339 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,109 developers. It's quick & easy.

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?????
Oct 23 '08 #1
  • viewed: 1403
Share:
6 Replies
numberwhun
Expert Mod 2GB
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
Oct 23 '08 #2
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
Oct 24 '08 #3
numberwhun
Expert Mod 2GB
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
Oct 24 '08 #4
KevinADC
Expert 2GB
see post below
Oct 24 '08 #5
KevinADC
Expert 2GB
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.
Oct 24 '08 #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.
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.
Oct 30 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Mike Bobbitt | last post: by
4 posts views Thread by Keith | last post: by
reply views Thread by Thomas | last post: by
6 posts views Thread by Michael L. Artz | last post: by
12 posts views Thread by rurpy@yahoo.com | last post: by
1 post views Thread by graphman | last post: by
31 posts views Thread by happyse27 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.