The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. September 23, 2019, 12:43:50 AM

Login with username, password and session length


Pages: [1]
  Print  
Author Topic: Can't locate xxx.pm in @INC  (Read 35038 times)
proton
n00b
*
Offline Offline

Posts: 5



View Profile
« on: July 20, 2007, 02:24:52 PM »

Hi there,

reading here and at syndk8 just for a while, I came across some problems ... maybe some of you can point me the right direction  Wink.

Some weeks ago I started learning perl using WinXP and Xampp (www.apachefriends.org) ... however, since perl was developed for UNIX and I'm already using KUbuntu and Gentoo, I thought I'd set up a local development environment at the first one. Ok, so far its done. I installed apache2, fastcgi and some other modules, setted up a virtual host in my home directory and successfully tested a little fast written cgi-script.

Since this worked, I wanted to install shadowMaker (Im sure, some here are familiar with this prog  ROFLMAO) at my virtual host, where I have to add that it runs without problems at my normal webspace, but here I got some error messages I can't get around. I guess it has something to do with my apache configuration  Huh?

Running shadowmaker.cgi in my browser it gives me an '500 internal server error'
My access.log:
Code:
127.0.0.1 - - [20/Jul/2007:23:07:47 +0200] "GET /cgi-bin/shadowmaker.cgi HTTP/1.1" 500 655 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.5) Gecko/20061201 Firefox/2.0.0.5 (Ubuntu-feisty)"
my error.log
Code:
[Fri Jul 20 23:07:47 2007] [error] (2)No such file or directory: exec of '/home/industrie13/web/shadow/cgi-bin/shadowmaker.cgi' failed
[Fri Jul 20 23:07:47 2007] [error] [client 127.0.0.1] Premature end of script headers: shadowmaker.cgi

and when I run it in command line, it gives me:
Code:
industrie13@linworks:~$ perl /home/industrie13/web/shadow/cgi-bin/shadowmaker.cgi
Content-type: text/html

<h1>Software error:</h1>
<pre>Can't locate SMSetup.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at /home/industrie13/web/shadow/cgi-bin/shadowmaker.cgi line 24.
BEGIN failed--compilation aborted at /home/industrie13/web/shadow/cgi-bin/shadowmaker.cgi line 24.
</pre>
<p>
For help, please send mail to this site's webmaster, giving this error message
and the time and date of the error.

</p>
[Fri Jul 20 23:11:24 2007] shadowmaker.cgi: Can't locate SMSetup.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at /home/industrie13/web/shadow/cgi-bin/shadowmaker.cgi line 24.
[Fri Jul 20 23:11:24 2007] shadowmaker.cgi: BEGIN failed--compilation aborted at /home/industrie13/web/shadow/cgi-bin/shadowmaker.cgi line 24.

Ok, SMSetup.pm is definitely in the same dir as shadowmaker.cgi and the dot '.' at the end of the @INC listing indicates, that it searches directory where the script itself is located too, but can't find it ... and that confuses me.
I could try to change the path to the .pm as an absolute path, but that could not be the solution, the error must be somewhere else.

My VH setup file is:
Code:
<VirtualHost 127.0.0.1>
ServerName shadow
DocumentRoot /home/industrie13/web/shadow/
ServerAdmin webmaster@localhost

<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/industrie13/web/shadow/>
Options ExecCGI Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
# This directive allows us to have apache2's default start page
                # in /apache2-default/, but still have / go to the right place
                #RedirectMatch ^/$ /apache2-default/
</Directory>

ScriptAlias /cgi-bin/ /home/industrie13/web/shadow/cgi-bin/
<Directory "/home/industrie13/web/shadow/cgi-bin">
    AllowOverride Indexes FileInfo Authconfig
    Options ExecCGI +Indexes +Includes +FollowSymlinks
    SetHandler cgi-script
    AddHandler cgi-script .cgi .pl
    Order allow,deny
    Allow from all
</Directory>

ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined
ServerSignature On

</VirtualHost>

anyone got an idea? trying to figure this out the whole evening  D'oh!
Logged

No links in signatures please
Bompa
Administrator
Lifer
*****
Offline Offline

Posts: 564


Where does this show?


View Profile
« Reply #1 on: July 20, 2007, 08:06:49 PM »

hi, i would put a copy of SMSetup.pm in /etc/perl or whatever just to see the effect.

also not sure if you're into perl or not, but perl is case sensitive

wish i could help more

Bompa
Logged

"The most beautiful and profound emotion we can experience is the sensation of the mystical..." - Albert Einstein
dirk
Global Moderator
Expert
*****
Offline Offline

Posts: 416


View Profile
« Reply #2 on: July 21, 2007, 10:45:27 AM »

Bompa,

as we have developed the script I have already sent an answer via PM.
(This is a normal support issue.)

But to give a more general answer which can also be interesting for
other scripts:

If loading a module Module.pm fails the path can be included, like:

Code:
BEGIN {
  push(@INC, '/absolute_path_name/');
};

use Module;

Logged
Pages: [1]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!