Solved

PHP oracle

Posted on 2001-09-02
6
374 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
ID: 6449728
maybe you should try  oci function in php instead of ODBC.
0
 
LVL 5

Author Comment

by:harwantgrewal
ID: 6451144
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
ID: 6451878
odbc and oci8 are different sets of functions.
anyway, can you post your code for connect oracle then?
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 5

Author Comment

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

?>


Harry
0
 
LVL 1

Accepted Solution

by:
kimcheng earned 100 total points
ID: 6455211
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
ID: 6517602
Got myself anyway thanks !

Harry
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to count occurrences of each item in an array.
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.

820 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