Gossamer Forum
Home : Products : Links 2.0 : Discussions :

HELP HELP!! db.pl @INC problems .

Quote Reply
HELP HELP!! db.pl @INC problems .
Hi Alex I have been recently speaking with Paul about pathname problems and where to place scripts;

I modified links.cfg and have the following paths;
# Paths and URL's to Important Stuff
# --------------------------------------------------------
# PATH and URL of Admin CGI directory. No Trailing Slash.
$db_script_path = "/web/au/org/distss/www/cgi-bin/links/admin";
$db_dir_url = "http://www.distss.org.au/cgi-bin/links/admin";

# URL of User CGI directory. No Trailing Slash.
$db_cgi_url = "http://www.distss.org.au/cgi-bin/links";

# PATH and URL of Pages to be built. No Trailing Slash.
$build_root_path = "/web/au/org/distss/www/docs/pages";
$build_root_url = "http://www.distss.org.au/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";

Error including libraries: Can't locate /db.pl in @INC (@INC contains: /web/au/org/distss/www/cgi-bin/links/admin /usr/lib/perl5/5.00503/i386-linux /usr/lib/perl5/5.00503 /usr/lib/perl5/site_perl/5.005/i386-linux /usr/lib/perl5/site_perl/5.005 .) at /web/au/org/distss/www/cgi-bin/links/admin/admin.cgi line 28.

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

I felt like I was geeting somewhere yesterday but now I am just more confused about what I need to do and how to achieve it.

I want to update using links a hot links page
eg. EDUCATION
htmllink. Then a description
INDUSTRY
htmllink. Then a description
Then I want to create a files uploaded screen. The user uploads a file and it with its description etc displayed. I know I can use links for this but I dont know how to implement it using links. I have only been using links for about a week and desperately need your help. I have a client on my back a deadlines are tight. Your advice will be invaluable.

Thanks
Gmac

Gmac
Integrated Business Applications Pty Ltd
Quote Reply
Re: HELP HELP!! db.pl @INC problems . In reply to
Are you definate db.pl and other .db, and .pl files are CHMODed to 666? May sound stupid, but thats often all it is! Smile

Andy

webmaster@ace-installer.com
http://www.ace-installer.com
Quote Reply
Re: db.pl @INC problems . In reply to
Try using the absolute path to links.cfg in admin.cgi as indicated countless times in the Installation Forum. Wink

Thomas
http://www.japanreference.com
Quote Reply
Re: db.pl @INC problems . In reply to
Thomas thanks for the reply.
I however dont think that is the problem because the admin.cgi script error message is generated after the error message is generated.
The variable $db_lib_path is not defined or generated in links.cfg or even returned as a value for $db_lib_pat h in admin.cgi. Refer the code below and the error messages. These are what gets generated on screen.

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;
}


Thanks for the help but I really need your further advice and experience in resolving this.

Regards
Gmac

Gmac
Integrated Business Applications Pty Ltd
Quote Reply
Re: HELP HELP!! db.pl @INC problems . In reply to
In Reply To:
Are you definate db.pl and other .db, and .pl files are CHMODed to 666? May sound stupid, but thats often all it is!
I think you will find that .pl files should be chmodded to 755.

Paul Wilson.
http://www.wiredon.net/gt/
http://www.perlmad.com/
Quote Reply
Re: db.pl @INC problems . In reply to
Hi,

The problem is in admin.cgi

Change this....

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.
};


.......to..........

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 "/web/au/org/distss/www/cgi-bin/links/adminlinks.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.
};





Paul Wilson.
http://www.wiredon.net/gt/
http://www.perlmad.com/
Quote Reply
Re: HELP HELP!! db.pl @INC problems . In reply to
Depends, if he is using a server that needs .pl extensions, then yes, but if he is using .cgi extensions, then 666 should work fine!

Andy

webmaster@ace-installer.com
http://www.ace-installer.com
Quote Reply
Re: HELP HELP!! db.pl @INC problems . In reply to
Errr NO youradds ALL .cgi and .pl files need to be chmodded to 755.

To make them executable



Paul Wilson.
http://www.wiredon.net/gt/
http://www.perlmad.com/
Quote Reply
Re: HELP HELP!! db.pl @INC problems . In reply to
It depends what the file is ie files like.

site_html_templates.pl, db_utils.pl, admin_html.pl

can be given 666 permissions because they don't need to be executable. They just need to be readable so as the other scripts can use the subs that they contain.

Good Luck!

Glenn
http://cgi-resource.co.uk/pages/links2mods.shtml
Quote Reply
Re: HELP HELP!! db.pl @INC problems . In reply to
Well I prefer chmodding them all - it does no harm and ensures everything works properly.

Paul Wilson.
http://www.wiredon.net/gt/
http://www.perlmad.com/
Quote Reply
Re: HELP HELP!! db.pl @INC problems . In reply to
Thanks Guys
After re-looking at the error message produced I had a closer look at the code that produced that error in admin.cgi to see if $db_lib_path was created or passed a value before or after links.cfg line was evaluated.
I placed a full path as suggested by Paul and retried but it failed on the next $db_lib_path line 28 or 29 of links.cfg. I replaced the full path with $db_lib_path and that pointed me to links.cfg and the line that that creates that variable $db_lib_path = $db_script_path;. I replace this line reset permissions and it works.

A good learning experience but unwanted stress under a tight deadline.

Thanks heaps

Regards
gmac

Gmac
Integrated Business Applications Pty Ltd
Quote Reply
Re: HELP HELP!! db.pl @INC problems . In reply to
Oops sorry it was my fault....I missed a forward slash in the path I gave you....

require "/web/au/org/distss/www/cgi-bin/links/adminlinks.cfg"; # Change this to full path to links.cfg if you have problems.


Put a slash between admin and links


Paul Wilson.
http://www.wiredon.net/gt/
http://www.perlmad.com/
Quote Reply
Re: HELP HELP!! db.pl @INC problems . In reply to
The next problem I have is now when trying to run any of the build options.
I get a message "The document contains no data. Try again later, or contact the server's Administrator"
I have already added links successfully.
links.db => 5|Disability Information Victoria|http://www.disabilityinfo.org.au|14-Mar-2001|Disability|This site provides information on numerous disability services in Victoria.|info|info@distss.org.au|0|Yes|No|0|0|Yes
6|DisAbility Services Division (Department of Human Services)|http://www.dhs.vic.gov.au|14-Mar-2001|Disability|Direct link to the DisAbility Services Division of the Victorian Department of Human Services. This site hosts a range of information for disability service providers.|info|info@distss.org.au|0|Yes|No|0|0|Yes
7|WebABLE|http://www.webable.com|14-Mar-2001|Disability|Includes a section on Web Accessibility Browsers|info|info@distss.org.au|0|Yes|No|0|0|Yes
8|Vicnet|http://www.vicnet.net.au|14-Mar-2001|Disability|A rich resource for those interested in this area|info|info@distss.org.au|0|Yes|No|0|0|Yes
9|Disability Services Division|http://www.dss.gov.au|14-Mar-2001|Disability|for the Commonwealth Department of Family and Community Services.|info|info@distss.org.au|0|Yes|No|0|0|Yes

I would appreciate help with this one as well.

Regards
Gmac



Gmac
Integrated Business Applications Pty Ltd
Quote Reply
Re: HELP HELP!! db.pl @INC problems . In reply to
Not sure exactly what you are asking, but just in case, can you execute NPH files on your server?

Andy

webmaster@ace-installer.com
http://www.ace-installer.com