Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now!
  #1  
Old December 9th, 2000, 01:14 AM
sameer sameer is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 1 sameer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hello Friends,
I am facing the problem when one of my test program tries to access the oracle database on NT using unix program on unix box. The program works fine on unix prompt. but when tried to get the output in the webbrowser it shows blank screen

Program code:
-------------------
#!/compat/linux/usr/bin/perl

#print "Content-type= text/htmlnn";
print "Content-type: text/htmlnn";

use DBI;
$dbh=DBI->connect("dbi:Oracle:host=10.0.0.151;sid=ORACLE;port=1521","esugar","esugar");
$stmt=$dbh->prepare("select * from tab");

#$stmt=$dbh->prepare("Show Table");

$stmt->execute;
while(my(@temparray)=$stmt->fetchrow_array)
{

print "$temparray[0]t$temparray[1]t$temparray[2]n";

}
--------------------------
httpd Error Log:

install_driver(Oracle) failed:
Can't load '/usr/lib/perl5/site_perl/i386-linux/auto/DBD/Oracle/Oracle.so'
for module DBD::Oracle: libclntsh.so.1.0: cannot open shared object file:
No such file or directory at /usr/lib/perl5/i386-linux/5.00405/DynaLoader.pm line 169.

at (eval 1) line 2

at /usr/local/www/data/oraperremote.pl line 7
---------------------------------------

The solution for this will be appreciated.
Thanks
Sameer


Reply With Quote
  #2  
Old December 10th, 2000, 11:54 PM
mccarren mccarren is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2000
Posts: 1 mccarren User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
It looks like the directory with the Oracle libraries is not a part of the LD_LIBRARY_PATH setting for the userid the CGI programs execute under. Add the directory containing "libcntlsh.so.1.0" to the LD_LIBRARY_PATH setting. You can do this in your program with <code>$ENV{"LD_LIBRARY_PATH"} .= ":/some/Oracle/path/"</code> This needs to appear before the <code>use DBI;</code> statement.

If you're running the program under mod_perl, you might want to make this setting in the script that starts your web server, so you don't have to add it you all your programs. Or you can set it in the environment for the userid used for your web server or cgi programs (whichever is appropriate).

Things worked when you run it at the command-line because the LD_LIBRARY_PATH is set for the userid you were testing with.

[This message has been edited by mccarren (edited December 10, 2000).]

Reply With Quote
  #3  
Old January 6th, 2001, 04:39 PM
fkxx fkxx is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 1 fkxx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I tried adding LD_LIBRARY_PATH to the code, before use DBI but with no sucess. In fact when running a test database script from the command prompt, only root and the oracle user can run it, whilst the other users cannot. any other suggestions? many thanks

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > Problems while accessing Oracle database


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway