in reply to Re^3: DBD::Sybase make problem
in thread DBD::Sybase make problem
Yeah! It's all about the libraries of freetds.
I exported all the libraries using LD_LIBRARY_PATH=/usr/local/freetds/lib
Now, I am able to use and execute some queries on this module. But, when I run sample cgi script, it's not going to execute.
Here is the sample code which I tried.
and the corresponding output when I execute this sample code:#!/usr/bin/perl BEGIN { $ENV{'SYBASE'} = '/usr/local/freetds'; $ENV{'LD_LIBRARY_PATH'} = '/usr/local/freetds/lib'; } use CGI; use CGI::Carp; use DBI; my $cgi = new CGI(); print $cgi->header(); my $cgi = new CGI(); my $path='/opt/ash/netcool'; my $hostname="192.168.2.95"; my $portno="4100"; my $database_name="NCOMS"; my $db_username="root"; my $db_password="access"; print <<EOF; <html> <head> <title>DBD Sybase Connection Check</title> </head> <body> <form name="myform"> EOF print "\nSyabse:$ENV{'SYBASE'}<br>LD_LIBRARY_PATH:$ENV{'LD_LIBRARY_PAT +H'}<br>"; print "<h2>**********----->$dbh<-----**********</h2>"; my $dbh = DBI->connect("dbi:Sybase:host=$hostname;port=$portno;server= +$database_name;",$db_username,$db_password) || warn "Database Connect +ion not made: $DBI::errstr"; print "<h2>**********$dbh**********</h2><br>"; print <<EOF; <br> </form> </body> </html> EOF
In console, by setting SYBASE=/usr/local/freetds and LD_LIBRARY_PATH=/usr/local/freetds/lib is[root@station34 cgi-bin]# ./dbdsybase.cgi Content-Type: text/html; charset=ISO-8859-1 <html> <head> <title>DBD Sybase Connection Check</title> </head> <body> <form name="myform"> install_driver(Sybase) failed: Can't load '/usr/lib/perl5/site_perl/5. +8.5/i386-linux-thread-multi/auto/DBD/Sybase/Sybase.so' for module DBD +::Sybase: libct.so.4: cannot open shared object file: No such file or + directory at /usr/lib/perl5/5.8.5/i386-linux-thread-multi/DynaLoader +.pm line 230. at (eval 8) line 3 Compilation failed in require at (eval 8) line 3. Perhaps a required shared library or dll isn't installed where expecte +d at ./dbdsybase.cgi line 29 Syabse:/usr/local/freetds<br>LD_LIBRARY_PATH:/usr/local/freetds/lib<br +><h2>**********-----><-----**********</h2>[root@station34 cgi-bin]#
On browser[root@station34 cgi-bin]# ./dbdsybase.cgi Content-Type: text/html; charset=ISO-8859-1 <html> <head> <title>DBD Sybase Connection Check</title> </head> <body> <form name="myform"> Syabse:/usr/local/freetds<br>LD_LIBRARY_PATH:/usr/local/freetds/lib<br +><h2>**********-----><-----**********</h2><h2>**********DBI::db=HASH( +0x87e56cc)**********</h2><br><br> </form> </body> </html>
which means that the partSyabse:/usr/local/freetds LD_LIBRARY_PATH:/usr/local/freetds/lib **********-----><-----**********
of the script is not executing due to connect statement. Also, why $DBI::errstr is not printing here.my $dbh = DBI->connect("dbi:Sybase:host=$hostname;port=$portno;server= +$database_name;",$db_username,$db_password) || warn "Database Connect +ion not made: $DBI::errstr"; print "<h2>**********$dbh**********</h2><br>"; print <<EOF; <br> </form> </body> </html> EOF
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: DBD::Sybase make problem
by Corion (Patriarch) on Jul 19, 2010 at 11:28 UTC | |
by ashok.g (Beadle) on Jul 19, 2010 at 14:31 UTC | |
by Anonymous Monk on Jul 19, 2010 at 14:48 UTC | |
by ashok.g (Beadle) on Jul 20, 2010 at 06:01 UTC | |
by Anonymous Monk on Jul 20, 2010 at 06:27 UTC | |
|