problem with DBD::Oracle



Our web server is running Apache 2.0.48 with mod_perl 1.99_12 on a Sun
machine running Solaris 9. We are running perl 5.8.1, DBI 1.39 and
DBD-Oracle 1.16. We are trying to connect from our web server to an
Oracle database that is on a different machine. The script that we
wrote to do this runs perfectly well when we run it from the command
line as a plain user. However, when we try running it from the web, we
cannot connect to the database.
When running from the web, the following environment variables are
printed properly:
TWO_TASK
ORACLE_SID
LIBPATH
LD_LIBRARY_PATH
ORACLE_HOME
SHLIB_PATH

I use the following code to connect to the database:
if ( ! ($dbh = DBI->connect("dbi:Oracle:", $dbuser, '', { PrintError =>
0, AutoCommit => 0 }))) {
print "Error: cannot connect to DB<br>\n";
exit(0);
}
$dbuser is defined as
$dbuser = 'userid/password';

After all the environment variables are printed out, I get the message
Error: cannot connect to DB

As I said at the start, the script works perfectly well from the
command line even when it is run from the same userid that the web runs
under.

Any suggestions to get this working from the web will be greatly
appreciated. Thanks in advance.




Malka Cymbalista
Webmaster, Weizmann Institute of Science
malki.cymbalista@xxxxxxxxxxxxxx
08-934-3036
.



Relevant Pages

  • RE: problem with DBD::Oracle
    ... Next, if it runs from the command line, then you most likely have a permissions issue with either the Perl script itself, or the Oracle.so library. ... Oracle database that is on a different machine. ... sender of the delivery error by replying to this message, or notify us by ...
    (perl.dbi.users)
  • Re: mysql connection failing as CGI
    ... some new hosting which comes with a MySQL database but I'm struggling ... to get it working with any perl scripts; the hosting support are being ... The problem basically is that when the script is run as a CGI script it ... the command line it runs fine. ...
    (comp.lang.perl.misc)
  • mysql connection failing as CGI
    ... some new hosting which comes with a MySQL database but I'm struggling ... to get it working with any perl scripts; the hosting support are being ... The problem basically is that when the script is run as a CGI script it ... the command line it runs fine. ...
    (comp.lang.perl.misc)
  • Re: How do I Edit a list of files associated with a product ?
    ... So it succesfully adds the product and the files in a database and the filesystem. ... and you have done something like that or you know a url or script that does that, ... Just build an edit command with the selected file name and ... you better check out the syntax for the exec command since it has additional parameters. ...
    (comp.lang.php)
  • Re: Oracle database not starting up after reboot on RedHat ES4 Linux !
    ... I have Oracle database enterprise edition 9.2.0.4 running on RedHat ... I am using dbstart command via a /etc/init.d/oracle file. ... When working with shell scripts that are executed by cron or on system startup, it is often useful to run those scripts in a manner that does not have your environment included in the execution of that script. ...
    (comp.databases.oracle.server)