Gossamer Forum
Quote Reply
Nothing works
My problem appears to be a path problem but I'm at wits end about what it could be. I'm not sure what actually spews out as when I go http://www.2ants.com/cgi-bin/links/admin/admin.cgi in internet explorer a window opens, a whole bunch of error messages fly by and then the window immediately closes. I added the line $input=<STDIN>; before the first exit; command just to try to stop it so I could read the messages. It didn't make a difference but when I execute the file from WS_FTP I get this error message

Content-type: text/plain

Error including libraries: Can't locate /cgi-bin/links/admin/db.pl in @INC (@INC
contains: C:\WINDOWS\TEMP D:\PERL\lib D:\PERL\site\lib .) at C:\WINDOWS\TEMP\DS
PF121.cgi line 28.

Make sure they exist, permissions are set properly, and paths are set correctly.

Links.cfg is in the same directory as admin.cgi. Here is an excerpt from links.cfg

# PATH and URL of Admin CGI directory. No Trailing Slash.
$db_script_path = "/cgi-bin/links/admin";
$db_dir_url = "http://www.2ants.com/cgi-bin/links/admin";

# URL of User CGI directory. No Trailing Slash.
$db_cgi_url = "http://www.2ants.com/cgi-bin/links";

# PATH and URL of Pages to be built. No Trailing Slash.
$build_root_path = "/pages";
$build_root_url = "http://www.2ants.com/pages";

# PATH and URL of What's New page. No Trailing slash.
$build_new_path = "$build_root_path/New";
$build_new_url = "$build_root_url/New";

# PATH and URL of What's Cool page. No Trailing slash.
$build_cool_path = "$build_root_path/Cool";
$build_cool_url = "$build_root_url/Cool";

# PATH and URL of What's Rating page. No Trailing slash.
$build_ratings_path = "$build_root_path/Ratings";
$build_ratings_url = "$build_root_url/Ratings";

I can't spot the error. I'm pretty sure that the permissions have been set just like the readme file directs. I asked my ISP if the path sounded OK and he said it did. In admin.cgi I tried changing require "links.cfg"; to require "/cgi-bin/links/admin/links.cfg" but there was no change. What do you think the problem is?
Quote Reply
Re: Nothing works In reply to
The error message is telling you that it can't locate the file db.pl, which suggests that your paths are incorrect.

Looking at your links.cfg I see:

$db_script_path = "/cgi-bin/links/admin";

and

$build_root_path = "/pages";

Those usually will not work. You need to define the entire path (absolute), not just a relative or partial path.

Try that and see if it works, and let us know!

--mark
Quote Reply
Re: Nothing works In reply to
OK I'll try to find out what the absolute path to my script is. But in the meantime I had a thought. The readme file said to change the permission for .cgi files to -rwxr-xr-x. What about the .pl files? On my system they default to -rw-r--r--. The readme file didn't mention them so I didn't change them. They should probably be executeable shouldn't they?
Quote Reply
Re: Nothing works In reply to
They don't need to be executable but they do need to be readable. When they are needed, the require statements in the other scripts make them a part of the executable (.cgi) that is running. So, in essence, they are executable in a round about way.
Quote Reply
Re: Nothing works In reply to
Ok so I found out the apparant absolute path to my scripts. Here is the e-mail from my ISP:


To: jason <helpyou@intergate.bc.ca>
From: Internet Gateway <staff@intergate.ca>
Subject: Re: Path?

Dear Jason:

The full path to your directory would be:

/httpd/htdocs/www.2ants.com

Therefore, if you create a directory called cgi-bin in your root directory
and upload a file named: script.cgi into it, it's absolute path would be:

/httpd/htdocs/www.2ants.com/cgi-bin/script.cgi

Sincerely,

Staff
Internet Gateway Corporation
800-889 West Pender
Vancouver, BC V6C-3B2
tel: (604) 654-6088 or (800) 453-1286
fax: (604) 669-8489 or (800) 453-1287
staff@intergate.ca

Here is an excerpt from links.cfg

# PATH and URL of Admin CGI directory. No Trailing Slash.
$db_script_path = "/httpd/htdocs/www.2ants.com/cgi-bin/links/admin";
$db_dir_url = "http://www.2ants.com/cgi-bin/links/admin";

# URL of User CGI directory. No Trailing Slash.
$db_cgi_url = "http://www.2ants.com/cgi-bin/links";

# PATH and URL of Pages to be built. No Trailing Slash.
$build_root_path = "/httpd/htdocs/www.2ants.com/pages";
$build_root_url = "http://www.2ants.com/pages";

# PATH and URL of What's New page. No Trailing slash.
$build_new_path = "$build_root_path/New";
$build_new_url = "$build_root_url/New";

# PATH and URL of What's Cool page. No Trailing slash.
$build_cool_path = "$build_root_path/Cool";
$build_cool_url = "$build_root_url/Cool";

# PATH and URL of What's Rating page. No Trailing slash.
$build_ratings_path = "$build_root_path/Ratings";
$build_ratings_url = "$build_root_url/Ratings";

Here is an excerpt from admin.cgi

eval {
($0 =~ m,(.*)/[^/]+,) && unshift (@INC, "$1"); # Get the script location: UNIX /
($0 =~ m,(.*)\\[^\\]+,) && unshift (@INC, "$1"); # Get the script location: Windows \

require 5.001; # Make sure we have at least perl 5.001.
require "/httpd/htdocs/www.2ants.com/cgi-bin/links/admin/links.cfg"; # Change this to full path to links.cfg if you have problems.
require "$db_lib_path/db.pl"; # Database Routines.
require "$db_lib_path/db_utils.pl"; # Database Support utilities.
require "$db_lib_path/admin_html.pl"; # Admin HTML routines.
};

And here is the result

Content-type: text/plain

Error including libraries: Can't locate /httpd/htdocs/www.2ants.com/cgi-bin/link
s/admin/links.cfg in @INC (@INC contains: C:\WINDOWS\TEMP D:\PERL\lib D:\PERL\si
te\lib .) at C:\WINDOWS\TEMP\DSP4313.cgi line 27.

Make sure they exist, permissions are set properly, and paths are set correctly.

I re-checked the permissions and they are as specified in the readme file.

It still looks like the path is wrong. Is there any script I could run which would tell me the path?
Quote Reply
Re: Nothing works In reply to
 
Quote:
Error including libraries: Can't locate /httpd/htdocs/www.2ants.com/cgi-bin/link
s/admin/links.cfg in @INC (@INC contains: C:\WINDOWS\TEMP D:\PERL\lib D:\PERL\si
te\lib .) at C:\WINDOWS\TEMP\DSP4313.cgi line 27.

Are you trying to run the script offline on a Windows system but accessing the database online? You can't do that. Check the first line of each .cgi script to make sure it is pointing to Perl on your ISPs system and run the script online.
Quote Reply
Re: Nothing works In reply to
I asked my ISP what the path to Perl was and I was told "/usr/bin/perl" so I put "#!/usr/bin/perl" at the top of all the .cgi files. I then re-read their email and it actually said The path to our Perl interpreter will depend on your website, but will generally be: /usr/bin/perl. I just e-mailed them back asking what "will depend on your website" actually means. I love how they give me just tid-bits of information at a time like "your path is /cgi-bin/links/admin" when this is not really the absolute path.
Quote Reply
Re: Nothing works In reply to
hi,

you can tray my litle script for DUMB your links absolute PATH.

download www.yahooid.com/linkmods/path.zip

may be this ca help you

------------------
http://www.yahooid.com


[This message has been edited by ARGA (edited May 14, 1999).]
Quote Reply
Re: Nothing works In reply to
I am having similiar problems see the topic "rocket scientist..".

I downloaded the path.cgi, ran it, copied the results to the links file AND Kaboom, it still did not work.

The boys & girls at Gossamer should include a simple self configuring cgi or something.

There are a lot of posts on this topic on the board.
Quote Reply
Re: Nothing works In reply to
siddhu,

I want see you link.cfg after you copy paste
From path result !

or see this
Quote:
$db_script_path = "/home/sudar/millenniumshiva-www/";
change to
Quote:
$db_script_path = "/home/sudar/millenniumshiva-www/cgi-bin/links/admin";

sorry I have fixed my path.cgi


[This message has been edited by ARGA (edited May 15, 1999).]
Quote Reply
Re: Nothing works In reply to
I think I'm starting to see the light. Here is an e-mail from my ISP.

Dear Jason,


The perl path is correct. It appears that a line(s) in the program are
not configured properly. It requires the correct full path to a file
called "admin_html.pl". You will need to make sure that you have entered
the correct path to the files required by his program. Also check the
permission of the files; make sure they are readable and executable by the
web server. i.e. the permissions have been changed after uploading the
files to the server.

Here is the start of admin.cgi

eval {
($0 =~ m,(.*)/[^/]+,) && unshift (@INC, "$1"); # Get the script location: UNIX /
($0 =~ m,(.*)\\[^\\]+,) && unshift (@INC, "$1"); # Get the script location: Windows \

require 5.001; # Make sure we have at least perl 5.001.
require "/httpd/htdocs/www.2ants.com/cgi-bin/links/admin/links.cfg"; # Change this to full path to links.cfg if you have problems.
require "$db_lib_path/db.pl"; # Database Routines.
require "$db_lib_path/db_utils.pl"; # Database Support utilities.
require "$db_lib_path/admin_html.pl"; # Admin HTML routines.
};

Where is "$db_lib_path" defined? Also I don't see any file named "admin_html.pl" though there is an "admin_ht.pl" in the cgi-bin/links/admin directory. Am I missing something? Thank you for the path.cgi script. I was a little hesitant to run given the spelling errors in the comments Wink but it did prove that /httpd/htdocs/www.2ants.com/ is truly my path.
Quote Reply
Re: Nothing works In reply to
Lose,

tray change "admin_ht.pl " to "admin_html.pl"

i have fixed path.cgi
don't forget to protect your admin directory!

------------------
http://www.yahooid.com


[This message has been edited by ARGA (edited May 15, 1999).]
Quote Reply
Re: Nothing works In reply to
Thank you for that suggestion! Guess what? It's alive!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Now I wonder how that happened and if there are any other misnamed files. Now on to password protecting the admin.cgi file. Thank you, thank you, thank you again!
Quote Reply
Re: Nothing works In reply to
Found the problem. When I unzipped the downloaded file I used an old, old (last modified August 1994) dos unzip program. You know what it did? It truncated all the files over 8 characters! So every file went from templates_html.pl to template.pl! Ain't computers great!