Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help! How to connect to Oracle 8 using php

Status
Not open for further replies.

JediDan

Programmer
May 15, 2002
128
US
I'm trying to connnect to an Oracle 8 database using TNSNAMES, through the oci8 driver in php. I loaded (by removing the ;) the php_oracle.dll and php_oci8.dll
libraries in the php.ini file. Here's the error I keep getting:

Fatal error: Call to undefined function: ocilogon() in c:\phpdev\ on line 9

This is the code:
Code:
<?
	putenv('ORACLE_HOME=mypath');
	$Oracle = OCILogon('USER','USER','DBNAME');
?>
The ORACLE_HOME path (changed here) is correct. What else needs to be done?

Any help is appreciated.
 
The key to making oracle work is that the web browser's environment should have the oracle variables set or you have to putenv() in the code. For portability purposes I like it either in a separate include()'ed file or in the shell environment when the browser is launched.
 
try this.

$conn = Ora_Logon(&quot;user@TNSNAME&quot;, &quot;pass&quot;);
ora_open ($conn)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top