Solved

PHP oracle

Posted on 2001-09-02
6
375 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Suggested Solutions

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
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 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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

740 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