Solved

not doing good with the install

Posted on 2003-10-31
12
224 Views
Last Modified: 2010-03-04
i am on a student login with no root priveledges and i am trying to run a perl script that
utilized GD and DBI at a different institution.  I have a friend who has given me a shell
account that has a MySQL database that i can connect to remotely.  don't ask me to
install anything on my home linux box because i have a win95 machine that isn't
even mine that runs ssh secure shell fine  i tried to save all the gz's for DBD, DBI, and GD
in a directory.. umm..

there..

/afs/sfsu.edu/mail4/kayve/public_html/cgi-bin/modules> ls
DBD-mysqlPP-0.04          DBI-1.38.tar              perl-DBI-1.30-1.i386.rpm
DBD-mysqlPP-0.04.tar      GD-2.11
DBI-1.38                  GD-2.11.tar
/afs/sfsu.edu/mail4/kayve/public_html/cgi-bin/modules>

(note the full path prompt i have with a .profile for ksh)

you can see what i have done.. i did make and install.. and it didn't like DBI because
it didn't have DBD so i did that. the web page *.cgi wasn't viewing thru a browser
so i tried the command line method:

/afs/sfsu.edu/mail4/kayve/public_html/cgi-bin> lab8_graph.cgi > outGD
Can't locate loadable object for module DBI in @INC (@INC contains: /afs/sfu.edu/mail4/kayve/public_html/cgi-bin /usr/local/lib/perl5/5.6.1/sun4-solaris /usr/local/lib/perl5/5.6.1 /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris /usr/local/lib/perl5/site_perl/5.6.1 /usr/local/lib/perl5/site_perl .) at DBI.pm line 255
BEGIN failed--compilation aborted at DBI.pm line 255.
Compilation failed in require at DBIGraph.pm line 9.
BEGIN failed--compilation aborted at DBIGraph.pm line 9.
Compilation failed in require at lab8_graph.cgi line 8.
BEGIN failed--compilation aborted at lab8_graph.cgi line 8.
/afs/sfsu.edu/mail4/kayve/public_html/cgi-bin>

my script is "lab8_graph.cgi" it utilizes a personal module called "DBIGraph.pm"

furthermore, i thought i would get cute by fixing @INC in DBIGraph.pm like so...
here is the first lines of that file:

package DBIGraph;
my $module_path = "/afs/sfsu.edu/mail4/kayve/public_html/cgi-bin/modules";
@INC = push(@INC,"${module_path}/GD-2.11");
@INC = push(@INC,"${module_path}/DBI-1.38");
use Exporter;
use FileHandle;
use CGI qw(:standard);
#use modules/DBI-1.38/DBI;
use DBI;
#use GD::Graph::lines;
#use modules/GD-2.11/GD;#::Image;
use GD;#::Image;


but i still get the error seen above.

0
Comment
Question by:kayvey
  • 5
  • 3
  • 3
12 Comments
 
LVL 20

Accepted Solution

by:
jmcg earned 125 total points
ID: 9662002
One of those error messages is complaining that it can't locate a "loadable object module" for DBI. That indicates that there is a component of DBI which must be compiled as part of the installation of the module. The question this message raises is whether you successfully ran the "make install" stage for the DBI module. Are the DBI-1.38 and GD-2.11 directories where you unzipped these packages or the destination PREFIX you gave to tell where to install the modules?

Check out the "use lib" pragmatic module. This is the preferred way to add library paths to the @INC array.

See the Perl FAQ item named "How do I keep my own module/library directory?"; it's in section 8 of the FAQ.


0
 
LVL 51

Assisted Solution

by:ahoffmann
ahoffmann earned 125 total points
ID: 9662902
you need to fix @INC in your script, something like:
  BEGIN{ unshift(@INC, q(/your/path/to/modules)); }
0
 

Author Comment

by:kayvey
ID: 9664489
i am thinking this means that i have not successfully installed:  

/afs/sfsu.edu/mail4/kayve/public_html/cgi-bin> lab8_graph.cgi > outGD
DBIGraph.pm did not return a true value at lab8_graph.cgi line 8.
BEGIN failed--compilation aborted at lab8_graph.cgi line 8.
/afs/sfsu.edu/mail4/kayve/public_html/cgi-bin>


i am not suprised.  okay.. ::sigh::


/afs/sfsu.edu/mail4/kayve/public_html/cgi-bin/modules/DBI-1.38> make test > maketest
Segmentation Fault - core dumped
        Using DBI::PurePerl (DBI_PUREPERL=2)
 Taint mode switching tests skipped

okay.. this is obviously bad:

/bin/sh -c true
/bin/sh -c true
/bin/sh -c true
PERL_DL_NONLAZY=1 /bin/perl -Iblib/arch -Iblib/lib -I/usr/local/lib/perl5/5.6.1/
sun4-solaris -I/usr/local/lib/perl5/5.6.1 -e 'use Test::Harness qw(&runtests $ve
rbose); $verbose=0; runtests @ARGV;' t/*.t
t/01basics..........dubious
        Test returned status 0 (wstat 139, 0x8b)
        test program seems to have generated a core
t/02dbidrv..........dubious
        Test returned status 0 (wstat 139, 0x8b)
        test program seems to have generated a core
t/03handle..........dubious
        Test returned status 0 (wstat 139, 0x8b)
        test program seems to have generated a core
DIED. FAILED tests 1-18
        Failed 18/18 tests, 0.00% okay
t/04mods............dubious
        Test returned status 0 (wstat 139, 0x8b)
        test program seems to have generated a core
DIED. FAILED tests 1-3
        Failed 3/3 tests, 0.00% okay


0
 
LVL 20

Expert Comment

by:jmcg
ID: 9664740
Well, the first message you got, about DBIGraph.pm not returning a true value, is just a small bug in your module. Most modules end with the line

1;

to satisfy this particular requirement of returning a true value.

As to the rest, yes, it does look like there's a problem with your DBI installation.
0
 

Author Comment

by:kayvey
ID: 9667534
i thought i put a "1" in there.. at some point i did..

umm.. so what do i do about the install problems?
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 20

Expert Comment

by:jmcg
ID: 9668010
It's hard to tell what went wrong with your DBI/DBD installation.

Without something more specific to go on, all I can suggest is to do it over, carefully reading the recipe given in the README files, and paying attention to any error messages coming from the 'make' and 'make test' steps. Be sure not to forget the PREFIX= parameter that will tell the install step where you want to place the results, since you're installing a private version of the library.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 9669326
> .. what do i do about the install problems?
if you have no root permissions, you need to install the modules somewhere local (in your home directory for example).
In this case you have to expand your @INC properly, as I described.
If the modules are instaled in the directory where your script starts, you may also use:
  use lib map("./lib$_", '', '/site_perl', '/perl5', '/perl5/site_perl');
(instead of my BEGIN{} suggestion).
0
 

Author Comment

by:kayvey
ID: 9674544
okay.. shine on that platform.  i am a lot closer on my friend's server

http://kayve.rubidia.com/lab8_graph.cgi


he has the DB working i guess.. but now we are having a hard time with GD::Graph::Lines

use DBI;
use GD::Graph::lines;
use GD;#::Image;


@ISA = Exporter;
@EXPORT=();
@EXPORT_OK=();

sub new {
   $class = shift;
   $ref = {};
   bless $ref, $class;
   return $ref;
}

sub display {
   my $now = `date` ;
   my $this = shift;
"DBIGraph.pm" 203L, 5211C written                            
[kayve@main public_html]$ ./lab8_graph.cgi > out
Can't locate object method "new" via package "GD::Graph::lines" (perhaps you forgot to load "GD::Graph::lines"?) at DBIGraph.pm line 171.
[kayve@main public_html]$


above you can see that i exited from DBIGraph.pm and then tried to run the script at the command line.
you can see that DBIGraph.pm has a use line for GD::Graph::lines so this error message is rather
confusing.  if that hint the error gives is true, then i don't understand what it means to "load" because
i would assume that "use" would "load" the package.  my friend suggests we have the wrong
lines package so now i am going to look for that.

here is what the actual fiile "lab8_graph.cgi" looks like:

#!/usr/bin/perl
use strict;
#BEGIN {
#   unshift (@INC, "/pub/cis/dputnam/perl5/lib/site_perl/5.6.1/PA-RISC2.0/");
#   unshift (@INC, "/pub/cis/dputnam/perl5/lib/site_perl/5.6.1/");
#}
#use lib ("/students/kriese01/public_html/cgi-bin");
use DBIGraph;
my $dbi_graph= DBIGraph->new("Test");
$dbi_graph->display();
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 9676773
your posting is confising too.
Which code did you run?
If it is the last 10 lines, I don't see where you use GD;
0
 
LVL 20

Expert Comment

by:jmcg
ID: 9683976
Somewhere much farther down in the DBIgraph.pm module than you have shown us, there is apparently an attempt to call a constructor for GD::Graph::lines. That's a bit of an odd capitalization for a class or package for something from CPAN -- "lines" looks more like  method than a class. It may be that you need to construct a GD::Graph object, not a GD::Graph::lines object.

But that's all at first blush, without seeing any of the relevant source code.
0
 
LVL 20

Expert Comment

by:jmcg
ID: 10040070
Nothing has happened on this question in more than 8 weeks. It's time for cleanup!

My recommendation, which I will post in the Cleanup topic area, is to
split points [grade B] between jmcg and ahoffman (abandoned, only partly resolved).

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jmcg
EE Cleanup Volunteer
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This video discusses moving either the default database or any database to a new volume.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now