LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-27-2007, 05:55 AM   #1
xpucto
Member
 
Registered: Sep 2005
Location: Vienna, Austria
Distribution: Mint 13
Posts: 522

Rep: Reputation: 31
Perl Script: [error] Can't locate WKC.pm in @INC


Hi!

I try to run perl scripts outside the cgi-bin directory but I get internal error. In error_log I get to read this:
Quote:
[Wed Apr 18 10:23:17 2007] [error] Can't locate WKC.pm in @INC (@INC contains: /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-multi /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/lib/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-multi /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 . /etc/httpd) at /var/www/wikicalc/wikicalccgi.pl line 23.\nBEGIN failed--compilation aborted at /var/www/wikicalc/wikicalccgi.pl line 23.\n
I canīt find the reason of this error message.
 
Old 04-27-2007, 06:04 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389
Hi,

It looks like a missing module (WKC.pm or a module that uses WKC). A quick look at CPAN shows that WKC is used by the Games::Trackword module.

Are there any lines in your perl script that look like this: use <somename>; ? (use warnings and/or use strict are supposed to be there).
 
Old 05-03-2007, 09:48 AM   #3
xpucto
Member
 
Registered: Sep 2005
Location: Vienna, Austria
Distribution: Mint 13
Posts: 522

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by druuna
Hi,

It looks like a missing module (WKC.pm or a module that uses WKC). A quick look at CPAN shows that WKC is used by the Games::Trackword module.

Are there any lines in your perl script that look like this: use <somename>; ? (use warnings and/or use strict are supposed to be there).
Hi druuna! thanks for answering. WKC.pm is in the programmīs directory right at the same place as the file
Quote:
/var/www/wikicalc/wikicalccgi.pl
that gives the error message. in
Quote:
/var/www/wikicalc/wikicalccgi.pl
at the line 23, there is:
Quote:
use WKC;
. but I donīt understand why it canīt find WKC.pm.
 
Old 05-03-2007, 10:32 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389
Hi,

What happens if you run it from within the cgi dir? and/or if you run it from the command line (perl wikicalc.pl). It could be a permissions issue.

You don't mention your http server (and version). I assume it's apache, version could be 2. If so, here's an URL that could help with the CGI stuff: Apache Tutorial: Dynamic Content with CGI

Hope this helps.
 
Old 05-16-2007, 09:25 AM   #5
xpucto
Member
 
Registered: Sep 2005
Location: Vienna, Austria
Distribution: Mint 13
Posts: 522

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by druuna
Hi,

What happens if you run it from within the cgi dir? and/or if you run it from the command line (perl wikicalc.pl). It could be a permissions issue.

You don't mention your http server (and version). I assume it's apache, version could be 2. If so, here's an URL that could help with the CGI stuff: Apache Tutorial: Dynamic Content with CGI

Hope this helps.
thanks for your answer. I use apache 2. I tried as you told me to run it locally! I ran it from cgi-dir, got the message
Quote:
wikiCalc 1.0
To access UI, display in browser: http://127.0.0.1:6556/
then I looged via ssh -X in order to browse the page from the server, an I went to . I then got the usuall page, and tested it... and it worked!! so I guess it is a firewall problem, but I don't se what I schould change in the configuration. wherre may I find the iptables'logs?
or could it be related to something else?

Last edited by xpucto; 05-16-2007 at 09:28 AM.
 
Old 05-16-2007, 09:34 AM   #6
xpucto
Member
 
Registered: Sep 2005
Location: Vienna, Austria
Distribution: Mint 13
Posts: 522

Original Poster
Rep: Reputation: 31
I found the iptables logs in /var/log/messages:
Quote:
May 16 16:32:22 myserver kernel: audit(1179325942.872:354): avc: denied { write } for pid=15536 comm="wikicalccgi.pl" name="demosite" dev=dm-0 ino=47382670 scontext=user_u:system_r:httpd_sys_script_t:s0 tcontext=user_u: object_r:httpd_sys_script_exec_t:s0 tclass=dir
what does that mean? what should I change in the iptables'configuration?

Last edited by xpucto; 05-16-2007 at 09:36 AM.
 
Old 05-16-2007, 10:34 AM   #7
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389
Hi,

This doesn't look iptable/firewall related, it looks like it is selinux (hardening) related.

I don't have any practical experience with selinux and cannot help you with that. Maybe some other LQ member has a clue.
 
Old 06-08-2007, 06:18 AM   #8
xpucto
Member
 
Registered: Sep 2005
Location: Vienna, Austria
Distribution: Mint 13
Posts: 522

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by druuna
Hi,

This doesn't look iptable/firewall related, it looks like it is selinux (hardening) related.

I don't have any practical experience with selinux and cannot help you with that. Maybe some other LQ member has a clue.
you are absolutly right.
Code:
setenforce 0
(to set selinux in permissive modus) made the whole stuff works.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl error in a Bash script rujin69 Programming 2 03-26-2007 02:40 PM
perl install error: Can't locate object method "new" via package "Module::Build::Vers powah Linux - Software 0 10-24-2006 01:57 PM
Perl Script Error. pete1234 Programming 3 12-21-2005 03:50 PM
Perl Script Error steve007 Programming 18 09-20-2005 03:54 AM
cgi-bin error regarding perl script hamish Linux - Software 11 12-09-2004 10:16 AM


All times are GMT -5. The time now is 10:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration