Can't connect to Oracle in mod_perl ????

2001-01-26 Thread Irek

Hi
I'm using RedHat6.2 + mod_perl 1.21 + perl 5.005_003 + Apache 1.3.12 (all
instaled with RH6.2) + X (gnome + kde). I instaled Oracle 8.1.6 + modles
Hires + DBI 1.14 + DBD-Oracle 1.06.
I write simple script :

#!/usr/bin/perl
use DBI;
my ( $inst, $user, $pass, $dbh);
print "Content-type: text/html\n\n";
$inst = "" ;
$user = "scott" ;
$pass = "tiger" ;
print "POINT 1 \nbr";
my $dbh = DBI-connect( "dbi:Oracle:$inst", $user, $pass,
{ AutoCommit = 0, RaiseError = 0, PrintError = 0 } )
   or print "ERROR : $DBI::errstr\nbr";
print "POINT 2 \nbr";
$dbh-disconnect;
print "POINT 3 \nbr";

User Oracle has in .bash_profile:

ORACLE_BASE=/home/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=/home/u01/app/oracle/product/8.1.6; export ORACLE_HOME
ORACLE_SID=ora1; export ORACLE_SID
PATH=$PATH:/home/u01/app/oracle/product/8.1.6/bin; export PATH
CLASSPATH=.:/home/u01/app/oracle/product/8.1.6/jdbc/lib/classes111.zip;
export CLASSPATH
LD_LIBRARY_PATH=/home/u01/app/oracle/product/8.1.6/lib; export
LD_LIBRARY_PATH
ORA_NLS33=/home/u01/app/oracle/product/8.1.6/ocommon/nls/admin/data; export
ORA_NLS33
NLS_LANG=american; export NLS_LANG

In httpd.conf I have to directories/locations:

ScriptAlias /cgi-bin/ "/home/httpd/cgi-bin/"
Directory "/home/httpd/cgi-bin"
SetEnv ORACLE_BASE /home/u01/app/oracle
SetEnv ORACLE_HOME /home/u01/app/oracle/product/8.1.6
SetEnv ORACLE_SID ora1
SetEnv CLASSPATH
.:/home/u01/app/oracle/product/8.1.6/jdbc/lib/classes111.zip
SetEnv LD_LIBRARY_PATH /home/u01/app/oracle/product/8.1.6/lib
SetEnv ORA_NLS33
/home/u01/app/oracle/product/8.1.6/ocommon/nls/admin/data
SetEnv NLS_LANG american
SetEnv PATH
/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/home/u01/app/oracle/product/8.
1.6/bin
AllowOverride AuthConfig FileInfo Indexes Limit Options
Options ExecCGI
Order allow,deny
Allow from all
/Directory

Alias /mod-perl/ /home/httpd/mod-perl/
Location /mod-perl
PerlSetEnv ORACLE_BASE /home/u01/app/oracle
PerlSetEnv ORACLE_HOME /home/u01/app/oracle/product/8.1.6
PerlSetEnv ORACLE_SID ora1
PerlSetEnv CLASSPATH
.:/home/u01/app/oracle/product/8.1.6/jdbc/lib/classes111.zip
PerlSetEnv LD_LIBRARY_PATH /home/u01/app/oracle/product/8.1.6/lib
PerlSetEnv ORA_NLS33
/home/u01/app/oracle/product/8.1.6/ocommon/nls/admin/data
PerlSetEnv NLS_LANG american
PerlSetEnv PATH
/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/home/u01/app/oracle/product/8.
1.6/bin
Options ExecCGI
  SetHandler perl-script
  PerlHandler Apache::Registry
  PerlSendHeader On
/Location

When I started this script in telnet user oracle (perl ora_test.cgi) all is
ok - script writes POINT1, POINT2, POINT3.
When I started this script in httpd in cgi-bin like
http://_adres_/cgi-bin/ora_test.cgi all is ok and script writes POINT1,
POINT2, POINT3
When I started this script in httpd in mod_perl like
http://_adres_/mod-perl/ora_test.cgi script writes only POINT1 !!

What can I do ?
PLEASE HELP !!!

Regards
Irek Smaczny




Re: Can't connect to Oracle in mod_perl ????

2001-01-26 Thread G.W. Haywood

Hi there,

On Fri, 26 Jan 2001, Irek wrote:

 When I started this script in httpd in mod_perl like
 http://_adres_/mod-perl/ora_test.cgi script writes only POINT1 !!

Have you looked in the error_log?

73,
Ged.




Re: Can't connect to Oracle in mod_perl ????

2001-01-26 Thread Irek

Are you thinking about httpd log ?
After restart httpd:

/var/log/httpd/access_log:
193.59.181.45 - - [26/Jan/2001:11:12:29 +0100] "GET /cgi-bin/ora_test.cgi
HTTP/1.1" 200 60
193.59.181.45 - - [26/Jan/2001:11:12:39 +0100] "GET /mod-perl/ora_test.cgi
HTTP/1.1" 200 28

/var/log/httpd/error_log:
[Fri Jan 26 11:12:16 2001] [notice] Apache/1.3.12 (Unix)  (Red Hat/Linux)
PHP/3.0.15 mod_perl/1.21 configured -- resuming normal operations
empty 


What else ???//

Regards
Irek Smaczny





Re: Can't connect to Oracle in mod_perl ????

2001-01-26 Thread Joshua Chamas

 /var/log/httpd/error_log:
 [Fri Jan 26 11:12:16 2001] [notice] Apache/1.3.12 (Unix)  (Red Hat/Linux)
 PHP/3.0.15 mod_perl/1.21 configured -- resuming normal operations
 empty 
 
 What else ???//
 
 Regards
 Irek Smaczny

If you have RaiseError = 1 in your DBI-connect() you will
get to see what's wrong in your error log likely.  

--Josh

_
Joshua Chamas   Chamas Enterprises Inc.
NodeWorks  free web link monitoring   Huntington Beach, CA  USA 
http://www.nodeworks.com1-714-625-4051



RE: Can't connect to Oracle in mod_perl ????

2001-01-26 Thread Geoffrey Young



 -Original Message-
 From: Irek [mailto:[EMAIL PROTECTED]]
 Sent: Friday, January 26, 2001 6:52 AM
 To: mod_perl list
 Subject: Re: Can't connect to Oracle in mod_perl 
 
 
 Use of inherited AUTOLOAD for non-method DBD::Oracle::ORA_OCI() is
 deprecated at 
 /usr/lib/perl5/site_perl/5.005/i386-linux/DBD/Oracle.pm line
 48.

I think I remember seeing this when DBD::Oracle 1.04 first came out and I
was playing with stuff...

try rebuilding DBD::Oracle after applying the following patch to 1.06:

--- Makefile.PL.old Wed Nov 29 13:11:39 2000
+++ Makefile.PL Wed Nov 29 13:11:55 2000
@@ -67,7 +67,7 @@
 my %mk_target_rules;
 
 # Options (rarely needed)
-$::opt_b = 1;  # try to use Oracle's own 'build' rule
+$::opt_b = 0;  # try to use Oracle's own 'build' rule
 $::opt_m = 0;  # path to proc.mk or oracle.mk file to read
 $::opt_p = ''; # alter preference for oracle.mk over proc
 $::opt_n = ''; # Oracle .mk macro name to use for library list to link with

HTH

--Geoff





Re: Can't connect to Oracle in mod_perl ????

2001-01-26 Thread Irek

Could you help me with this sollution ?
I understand, that I must change Makefile.PL line
$::opt_b = 1
to
$::opt_b = 0

It is correct ? (and install again)

Regards
Irek Smaczny





Re: Can't connect to Oracle in mod_perl ????

2001-01-26 Thread Irek

Yes, now it is OK 
THANK YOU !!

THX :-)))

Regards 
Irek Smaczny