How to add a user to the friend list?
CGI and Oracle Question,
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What can I do?
• What to Read?
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Зарегистрируйся!

QAIX > Perl web-programming > CGI and Oracle Question, 29 August 2008 11:15:47

  Recent blog posts: 
  They have birthday today: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Moderators:

CGI and Oracle Question,

Naser Ali 29 August 2008 11:15:47
 Hello Everyone,

I am trying to access Oracle database object (a table's contents) through a
CGI script to print the information on the web page, but I am continuously
getting this error message,

"ORACLE_HOME environment variable not set!
DBI->connect(aali) failed: Error while trying to retrieve text for error
ORA-12154 (DBD ERROR: OCIServerAttach) at /www/cgi-bin/plo4
Can't Connect to the Database: Error while trying to retrieve text for error
ORA-12154 (DBD ERROR: OCIServerAttach)
[Fri Jul 5 10:17:12 2002] [error] [client 152.225.94.80] Premature end of
script headers: /www/cgi-bin/plot4.­pl"

the owner and group of CGI script and httpd is www/www, whereas oracles
user and group oracle/dba. If I run another script from command line with
same code logic and syntax just to check that user "www" I am able to
connect to database, it works fine. I am not sure what I am missing here.
Any pointers and help will be appreciated.
Regards
Add comment
Guest 5 July 2002 17:42:33 permanent link ]
 You will need to set your $ORACLE_HOME

$ORACLE_HOME = "/path/to/oracle";

-----Original Message-----
From: Naser Ali [mailto:Ali.Naser@irs.gov]
Sent: Friday, July 05, 2002 9:32 AM
To: 'beginners@perl.org­'
Subject: CGI and Oracle Question,


Hello Everyone,

I am trying to access Oracle database object (a table's contents) through a
CGI script to print the information on the web page, but I am continuously
getting this error message,

"ORACLE_HOME environment variable not set!
DBI->connect(aali) failed: Error while trying to retrieve text for error
ORA-12154 (DBD ERROR: OCIServerAttach) at /www/cgi-bin/plo4
Can't Connect to the Database: Error while trying to retrieve text for error
ORA-12154 (DBD ERROR: OCIServerAttach)
[Fri Jul 5 10:17:12 2002] [error] [client 152.225.94.80] Premature end of
script headers: /www/cgi-bin/plot4.­pl"

the owner and group of CGI script and httpd is www/www, whereas oracles
user and group oracle/dba. If I run another script from command line with
same code logic and syntax just to check that user "www" I am able to
connect to database, it works fine. I am not sure what I am missing here.
Any pointers and help will be appreciated.
Regards
Add comment
Naser Ali 5 July 2002 17:55:26 permanent link ]
 I did. It is set in the .profile of user www. I dont know how to set it
inside thecalling script though.?

-----Original Message-----
From: TomST@netins.com [mailto:TomST@netins.com]
Sent: Friday, July 05, 2002 10:43 AM
To: Ali.Naser@irs.gov; beginners@perl.org
Subject: RE: CGI and Oracle Question,


You will need to set your $ORACLE_HOME

$ORACLE_HOME = "/path/to/oracle";

-----Original Message-----
From: Naser Ali [mailto:Ali.Naser@irs.gov]
Sent: Friday, July 05, 2002 9:32 AM
To: 'beginners@perl.org­'
Subject: CGI and Oracle Question,


Hello Everyone,

I am trying to access Oracle database object (a table's contents) through a
CGI script to print the information on the web page, but I am continuously
getting this error message,

"ORACLE_HOME environment variable not set!
DBI->connect(aali) failed: Error while trying to retrieve text for error
ORA-12154 (DBD ERROR: OCIServerAttach) at /www/cgi-bin/plo4
Can't Connect to the Database: Error while trying to retrieve text for error
ORA-12154 (DBD ERROR: OCIServerAttach)
[Fri Jul 5 10:17:12 2002] [error] [client 152.225.94.80] Premature end of
script headers: /www/cgi-bin/plot4.­pl"

the owner and group of CGI script and httpd is www/www, whereas oracles
user and group oracle/dba. If I run another script from command line with
same code logic and syntax just to check that user "www" I am able to
connect to database, it works fine. I am not sure what I am missing here.
Any pointers and help will be appreciated.
Regards
Add comment
Naser Ali 5 July 2002 18:05:33 permanent link ]
 Thanks Stephen,

I added the line as you mentioned. I am getting this error message. I
verified the TNS settings by logging into database using sqlplus as user
"www" and it worked fine.
===================­========
DBI->connect(aali, aali, aali) failed: ORA-12154: TNS:could not resolve
service name (DBD ERROR: OCIServerAttach) at /www/cgi-bin/pl
ot5.pl line 16
Can't locate auto/DBI/prepare.al­ in @INC (@INC contains:
/usr/local/lib/perl­5/5.6.1/sun4-solaris­ /usr/local/lib/perl­5/5.6.1 /usr/loc
al/lib/perl5/site_p­erl/5.6.1/sun4-solar­is
/usr/local/lib/perl­5/site_perl/5.6.1 /usr/local/lib/perl­5/site_perl .) at
/www/cgi-bin/plo
t5.pl line 17
[Fri Jul 5 10:56:52 2002] [error] [client 152.225.94.80] Premature end of
script headers: /www/cgi-bin/plot5.­pl
===================­========


-----Original Message-----
From: stephen.redding@bt.­com [mailto:stephen.redding@bt.com]
Sent: Friday, July 05, 2002 10:48 AM
To: Ali.Naser@irs.gov
Subject: RE: CGI and Oracle Question,


try adding this to the beginning

BEGIN {
$ENV{ORACLE_HOME} = '/opt/oracle etc';
$ENV{ORACLE_SID} = 'SID';
}

Stephen Redding

BT Ignite Solutions
Telephone - 0113 237 3312
Fax - 0113 244 1413
Email - stephen.redding@bt.­com
http://www.technet.­bt.com/sit/public/


British Telecommunications plc
Registered office: 81 Newgate Street London EC1A 7AJ
Registered in England no. 1800000
This electronic message contains information from British Telecommunications
plc which may be privileged or confidential. The information is intended to
be for the use of the individual(s) or entity named above. If you are not
the intended recipient be aware that any disclosure, copying, distribution
or use of the contents of this information is prohibited. If you have
received this electronic message in error, please notify us by telephone or
email (to the numbers or address above) immediately.



-----Original Message-----
From: Naser Ali [mailto:Ali.Naser@irs.gov]
Sent: Friday, July 05, 2002 15:32
To: 'beginners@perl.org­'
Subject: CGI and Oracle Question,


Hello Everyone,

I am trying to access Oracle database object (a table's contents) through a
CGI script to print the information on the web page, but I am continuously
getting this error message,

"ORACLE_HOME environment variable not set!
DBI->connect(aali) failed: Error while trying to retrieve text for error
ORA-12154 (DBD ERROR: OCIServerAttach) at /www/cgi-bin/plo4
Can't Connect to the Database: Error while trying to retrieve text for error
ORA-12154 (DBD ERROR: OCIServerAttach)
[Fri Jul 5 10:17:12 2002] [error] [client 152.225.94.80] Premature end of
script headers: /www/cgi-bin/plot4.­pl"

the owner and group of CGI script and httpd is www/www, whereas oracles
user and group oracle/dba. If I run another script from command line with
same code logic and syntax just to check that user "www" I am able to
connect to database, it works fine. I am not sure what I am missing here.
Any pointers and help will be appreciated.
Regards
Add comment
Anders Holm 5 July 2002 18:11:38 permanent link ]
 Hi.

Seems like something isn't installed properly:
Can't locate auto/DBI/prepare.al­ in @INC

You're missing a module or something. Not too familiar with DBI myself, so
don't know which one, but checking search.cpan.org for DBI and Oracle might
be helpful (?)...

Best Regards

Anders Holm
Critical Path Technical Support Engineer
-------------------­--------------------­--------------------­-----------
Tel USA/Canada:1 800 353 8437
Tel Worldwide:+1 801 736 0806
E-mail:technical.su­pport@cp.net
Internet:http://sup­port.cp.net

-----Original Message-----> From: Naser Ali [mailto:Ali.Naser@irs.gov]> Sent: 05 July 2002 16:06> To: 'stephen.redding@bt­.com'> Cc: beginners@perl.org>­ Subject: RE: CGI and Oracle Question,>
Thanks Stephen,>
I added the line as you mentioned. I am getting this error message. I> verified the TNS settings by logging into database using sqlplus as user> "www" and it worked fine.> ===================­========> DBI->connect(aali, aali, aali) failed: ORA-12154: TNS:could not resolve> service name (DBD ERROR: OCIServerAttach) at /www/cgi-bin/pl> ot5.pl line 16> Can't locate auto/DBI/prepare.al­ in @INC (@INC contains:> /usr/local/lib/perl­5/5.6.1/sun4-solaris­> /usr/local/lib/perl­5/5.6.1 /usr/loc> al/lib/perl5/site_p­erl/5.6.1/sun4-solar­is> /usr/local/lib/perl­5/site_perl/5.6.1 /usr/local/lib/perl­5/site_perl .) at> /www/cgi-bin/plo> t5.pl line 17> [Fri Jul 5 10:56:52 2002] [error] [client 152.225.94.80] Premature end of> script headers: /www/cgi-bin/plot5.­pl> ===================­========>
-----Original Message-----> From: stephen.redding@bt.­com [mailto:stephen.redding@bt.com]> Sent: Friday, July 05, 2002 10:48 AM> To: Ali.Naser@irs.gov> Subject: RE: CGI and Oracle Question,>
try adding this to the beginning>
BEGIN {> $ENV{ORACLE_HOME} = '/opt/oracle etc';> $ENV{ORACLE_SID} = 'SID';> }>
Stephen Redding>
BT Ignite Solutions> Telephone - 0113 237 3312> Fax - 0113 244 1413> Email - stephen.redding@bt.­com> http://www.technet.­bt.com/sit/public/>
British Telecommunications plc> Registered office: 81 Newgate Street London EC1A 7AJ> Registered in England no. 1800000> This electronic message contains information from British> Telecommunications>­ plc which may be privileged or confidential. The information is> intended to> be for the use of the individual(s) or entity named above. If you are not> the intended recipient be aware that any disclosure, copying, distribution> or use of the contents of this information is prohibited. If you have> received this electronic message in error, please notify us by> telephone or> email (to the numbers or address above) immediately.>
-----Original Message-----> From: Naser Ali [mailto:Ali.Naser@irs.gov]> Sent: Friday, July 05, 2002 15:32> To: 'beginners@perl.org­'> Subject: CGI and Oracle Question,>
Hello Everyone,>
I am trying to access Oracle database object (a table's contents)> through a> CGI script to print the information on the web page, but I am continuously> getting this error message,>
"ORACLE_HOME environment variable not set!> DBI->connect(aali) failed: Error while trying to retrieve text for error> ORA-12154 (DBD ERROR: OCIServerAttach) at /www/cgi-bin/plo4> Can't Connect to the Database: Error while trying to retrieve> text for error> ORA-12154 (DBD ERROR: OCIServerAttach)> [Fri Jul 5 10:17:12 2002] [error] [client 152.225.94.80] Premature end of> script headers: /www/cgi-bin/plot4.­pl">
the owner and group of CGI script and httpd is www/www, whereas oracles> user and group oracle/dba. If I run another script from command line with> same code logic and syntax just to check that user "www" I am able to> connect to database, it works fine. I am not sure what I am missing here.> Any pointers and help will be appreciated.> Regards>
Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или УК РФ.


QAIX > Perl web-programming > CGI and Oracle Question, 29 August 2008 11:15:47

see also:
Strange behavior on non-existent field…
Can't get ECPG to connect (was Re…
why not kill -9 postmaster
пройди тесты:
see also:
How to transfer iTunes M4P music to…
How to import iTunes M4P music to…
How to convert iTunes M4P to PSP

  Copyright © 2001—2008 QAIX
Idea: Miсhael Monashev
Помощь и задать вопросы можно в сообществе support.qaix.com.
Сообщения об ошибках оставляем в сообществе bugs.qaix.com.
Предложения и комментарии пишем в сообществе suggest.qaix.com.
Информация для родителей.
Write us at:
If you would like to report an abuse of our service, such as a spam message, please .