Gossamer Forum
Home : Products : Links 2.0 : Installation -- Unix :

Yet another admin.cgi error

Quote Reply
Yet another admin.cgi error
Hello,

I'm receiving this error:

--------
Error including libraries: Can't locate /tarotfool/cgi-bin/links/admin/db.pl in @INC (@INC contains: /usr/libdata/perl/5.00502/mach /usr/libdata/perl/5.00502 /usr/local/lib/perl5/site_perl/5.005/i386-freebsd /usr/local/lib/perl5/site_perl/5.005 .) at admin.cgi line 28.

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

------------

I've read all the posts from those with similar errors, have tried changing paths to longer absolute paths, have made sure db.pl was uploaded in ASCii, and have made sure the chmod is set to 644.

Any ideas?

Here is my admin.cgi

TIA,
Julie

#!/usr/bin/perl
# -------------
# Links
# -------------
# Links Manager
#
# File: admin.cgi
# Description: This is the administrative interface for the links program.
# Author: Alex Krohn
# Email: alex@gossamer-threads.com
# Web: http://www.gossamer-threads.com/
# Version: 2.0
#
# (c) 1998 Gossamer Threads Inc.
#
# This script is not freeware! Please read the README for full details
# on registration and terms of use.
# =====================================================================
#
# Required Librariers
# --------------------------------------------------------
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 "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.
};

if ($@) {
print "Content-type: text/plain\n\n";
print "Error including libraries: $@\n";
print "Make sure they exist, permissions are set properly, and paths are set correctly.";
exit;
}

# ========================================================
eval { &main; }; # Trap any fatal errors so the program hopefully
if ($@) { &cgierr("fatal error: $@"); } # never produces that nasty 500 server error page.
exit; # There are only two exit calls in the script, here and in in &cgierr.
# ========================================================

sub main {
# --------------------------------------------------------
$| = 1; # Flush Output Right Away

# Main Menu. Check to see what the user requested, then if he has permission for that
# request, do it. Otherwise send the user off to an unauthorized request page.
%in = &parse_form; # Get form input so we know which database to load.

# Load the database definition file and set the link url.
$in{'db'} ?
require "$db_lib_path/$in{'db'}.def" :
require "$db_lib_path/links.def";

$db_script_link_url = "$db_script_url?db=$in{'db'}";

# The functions beginning with &html_ can be found in admin_html.pl, while the other
# functions can be found in db.pl

if ($in{'add_form'}) { &html_add_form; } # Display the Add Record Form.
elsif ($in{'add_record'}) { &add_record; } # Add the Actual Record.
elsif ($in{'add_record_mult'}) { &add_record_mult; } # Add Multiple Records at once (beta).
elsif ($in{'view_search'}) { &html_view_search; } # Display form to search database.
elsif ($in{'view_records'}) { &view_records; } # Search database and print results.
elsif ($in{'delete_search'}) { &html_delete_search; } # Display the form to search for records to delete.
elsif ($in{'delete_form'}) { &html_delete_form; } # Display the form to pick records to delete.
elsif ($in{'delete_records'}) { &delete_records; } # Delete records.
elsif ($in{'modify_search'}) { &html_modify_search; } # Display the form to search for records to modify.
elsif ($in{'modify_mult_form'}) { &html_modify_mult_form; } # Display multiple records to modify at one time.
elsif ($in{'modify_form'}) { &html_modify_form; } # Display the form to pick record to modify.
elsif ($in{'modify_form_record'}) { &html_modify_form_record; } # Display the form to modify a record.
elsif ($in{'modify_record'}) { &modify_record; } # Modify the record.
elsif ($in{'modify_mult_record'}) { &modify_mult_record; } # Modify multiple records at once.
elsif ($in{'validate_form'}) { &html_validate_form; } # Display the Validation Form.
elsif ($in{'validate_records'}) { &validate_records; } # Validate records.
elsif ($in{'check_links'}) { &check_links; } # Display/Check to make sure links have matching catgories.
elsif ($in{'fix_links'}) { &fix_links; } # Fixes up any errors found in check links.
elsif ($in{'check_duplicates'}) { &check_duplicates; } # Display/Check for duplicate links.
elsif ($in{'html_mail_target'}) { &html_mail_target; } # Form to do targeted mass mailing.
elsif ($in{'html_mail_form'}) { &html_mail_form; } # Form to do mass mailing.
elsif ($in{'html_mail_update'}) { &html_mail_update; } # Form to do email updates.
elsif ($in{'html_edit_template'}) { &html_edit_template; } # Edit Templates
elsif ($in{'save_template'}) { &save_template; } # Save templates.
elsif ($in{'html_template_help'}) { &html_template_help; } # Template Help.
elsif ($in{'display'} eq 'navigation') { &html_navigation; } # Display HTML Header
elsif ($in{'display'} eq 'body') { &html_body; } # Display HTML Body
elsif ($in{'display'} eq 'top') { &html_top; } # Display HTML Top
else { &html_home; } # Display Frame Index page.

# &cgierr("Done"); # Uncomment this line for Debugging... Will tack on form variables and environment variables
# to the end of every page. Quite Useful.
}
Quote Reply
Re: Yet another admin.cgi error In reply to
 
Quote:
require "links.cfg"; # Change this to full path to links.cfg if you have problems.

I hope this helps.
Quote Reply
Re: Yet another admin.cgi error In reply to
Bobsie,

Thanks. I already tried that, though--I've tried it both ways. About ready to tear my hair out!

Julie
Quote Reply
Re: Yet another admin.cgi error In reply to
Please post the top 5 paths/URLs you have in links.cfg.
Quote Reply
Re: Yet another admin.cgi error In reply to
Bobsie,

Thanks so much. Here they are...

Julie

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

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

# PATH and URL of Pages to be built. No Trailing Slash.
$build_root_path = "/tarotfool/pages";
$build_root_url = "http://webrelish.com/tarotfool/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";
Quote Reply
Re: Yet another admin.cgi error In reply to
Is your root directory actually "/tarotfool" with nothing before it? If there are directories before it, then they should be included to constitute a full absolute path from your root directory.
Quote Reply
Re: Yet another admin.cgi error In reply to
Bobsie,

No, there are no directories above "tarotfool".

Julie
Quote Reply
Re: Yet another admin.cgi error In reply to
Is the top line of admin.cgi using the correct path to perl on your system?

Was your links.cfg file uploaded as ASCII?



[This message has been edited by Bobsie (edited July 12, 1999).]
Quote Reply
Re: Yet another admin.cgi error In reply to
Yes, I uploaded links.cfg as ASCII. I also have re-uploaded adming.cgi, links.cfg, and db.pl as ASCII just in case. Still no go.

The path to perl is what my hosting company lists on their support pages as the correct path, but i have emailed them to verify. Haven't heard back yet.

Julie
Quote Reply
Re: Yet another admin.cgi error In reply to
Julie,

Just to satisfy my curiosity, what editor are you using for your html editing? I ask this because, when I looked at links.cfg on your system, this is what displayed:

Quote:
# ------------- # Links # ------------- # Links Manager # # File: links.cfg # Description: Contains all the setup variables. # Author: Alex
Krohn # Email: alex@gossamer-threads.com # Web: http://www.gossamer-threads.com/ # Version: 2.0 # # (c) 1998 Gossamer
Threads Inc. # # This script is not freeware! Please read the README for full details # on registration and terms of use. #
===================================================================== # Paths and URL's to Important
Stuff
( ... remainder snipped ... )

This is how it should have displayed:

Quote:
# -------------
# Links
# -------------
# Links Manager
#
# File: links.cfg
# Description: Contains all the setup variables.
# Author: Alex Krohn
# Email: alex@gossamer-threads.com
# Web: http://www.gossamer-threads.com/
# Version: 2.0
#
# (c) 1998 Gossamer Threads Inc.
#
# This script is not freeware! Please read the README for full details
# on registration and terms of use.
# =====================================================================

# Paths and URL's to Important Stuff
( ... remainder snipped ...}

So your editor may not be saving the files correctly to begin with because each line seems to be missing an end of line character.


[This message has been edited by Bobsie (edited July 12, 1999).]
Quote Reply
Re: Yet another admin.cgi error In reply to
Bobsie,

Was using HomeSite 3.0, but switched to NotePad because I thought HomeSite might be doing strange things to the script. I thought I reconfigured any files I had opened with HomeSite from the original downloads, using NotePad in case that was the problem. I'll double check, though.

Thanks for all your help.

J
Quote Reply
Re: Yet another admin.cgi error In reply to
As a Homesite user myself, I can assure you that it doesn't do any funny things to the scripts and should be able to be used just fine. You just need to configure it to accept .cgi, .pm, and .pl files as html (even though they are not really html) in order to edit them.

I was sure, though, that Notepad would have saved those files correctly. But something is wrong with the end-of-lines in your links.cfg and may also in other files.
Quote Reply
Re: Yet another admin.cgi error In reply to
Yikes!

Started fresh with the admin.cgi, db.pl, and links.cfg (again) and uploaded in ASCII. They now look "normal" from the server.

However, I'm still getting the same error.
Quote Reply
Re: Yet another admin.cgi error In reply to
Double-check the permissions of the files in the admin directory and the admin directory itself. They should be:

Code:
cgi-bin/admin - drwxr-xr-x (755):
-rw-r--r-- (644) 11923 Mailer.pm
-rw-r--r-- (644) 4525 Template.pm
-rw-r--r-- (644) 3217 Validator.pm
-rwxr-xr-x (755) 5886 admin.cgi*
-rw-r--r-- (644) 71022 admin_html.pl
-rw-r--r-- (644) 3118 category.def
-rw-r--r-- (644) 37892 db.pl
-rw-r--r-- (644) 23351 db_utils.pl
-rw-r--r-- (644) 10315 links.cfg
-rw-r--r-- (644) 4669 links.def
-rwxr-xr-x (755) 47765 nph-build.cgi*
-rwxr-xr-x (755) 7488 nph-email.cgi*
-rwxr-xr-x (755) 9721 nph-verify.cgi*
-rw-r--r-- (644) 37114 site_html.pl
-rw-r--r-- (644) 16354 site_html_templates.pl

We'll get to the bottom of this yet! If that doesn't help, then if you can email me ftp access, I will try to see what is going on. My email address is bobsie@orphanage.com

[This message has been edited by Bobsie (edited July 12, 1999).]
Quote Reply
Re: Yet another admin.cgi error In reply to
Bobsie,

Just wanted to confirm that you received email with FTP info. I have verified that the path to perl is correct on the scripts (/usr/bin/perl)

Thanks again,

J
Quote Reply
Re: Yet another admin.cgi error In reply to
Yes, I got the email and I will be checking the site out as soon as I can... probably sometime later today after I get some sleep.