Solved

PHP oracle

Posted on 2001-09-02
6
371 Views
Last Modified: 2012-06-21
Hi
I am using PHP and Oracle 8i on win2000Server I set up oracle fine. Everything is running in SQLplus and even in the coldfusion using the ODBC connection. But when I use the oci8.dll and oracle.dll and odbc function it gives me error like


Warning: Oracle: Connection Failed: ORA-12638: Credential retrieval failed in c:\inetpub\wwwroot\php\oracle.php on line 3

I had already set the env variables ORACLE_HOME< ORECLE_SID etc.

Please Help me

harry
0
Comment
Question by:harwantgrewal
  • 3
  • 3
6 Comments
 
LVL 1

Expert Comment

by:kimcheng
Comment Utility
maybe you should try  oci function in php instead of ODBC.
0
 
LVL 5

Author Comment

by:harwantgrewal
Comment Utility
But when I use the oci8.dll and oracle.dll and
odbc function it gives me error like


I think this line indicates that I use both of the functions.

Harry
0
 
LVL 1

Expert Comment

by:kimcheng
Comment Utility
odbc and oci8 are different sets of functions.
anyway, can you post your code for connect oracle then?
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 5

Author Comment

by:harwantgrewal
Comment Utility
<?php
$db="harry.deepblue";
$user="system";
$pass="manager";
OCIlogon($user,$pass,$db);

?>


Harry
0
 
LVL 1

Accepted Solution

by:
kimcheng earned 100 total points
Comment Utility
you didn't setup the oracle variable correctly. so php doesn't know about the default oracle db name. also, er.... wrong grammar. try the code list below

<?php
PutEnv("ORACLE_SID=harry.deepblue");
$user="system";
$pass="manager";

$connection = Ora_Logon ($user, $pass);
if (!$connection){
  echo Ora_ErrorCode($connection).": ".Ora_Error($connection)."<BR>";
  exit;
}  

?>
0
 
LVL 5

Author Comment

by:harwantgrewal
Comment Utility
Got myself anyway thanks !

Harry
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now