By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,933 Members | 1,675 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,933 IT Pros & Developers. It's quick & easy.

Perl and Apache

P: 3
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
Share this Question
Share on Google+
6 Replies


numberwhun
Expert Mod 2.5K+
P: 3,503
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

P: 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
Oct 24 '08 #3

numberwhun
Expert Mod 2.5K+
P: 3,503
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 2.5K+
P: 4,059
see post below
Oct 24 '08 #5

KevinADC
Expert 2.5K+
P: 4,059
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

P: 3
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.