note 7356 deleted from function.ociplogon by sixd
| From: | sixd@php.net | Date: | Mon, 05 Oct 2009 01:18:49 +0000 |
| Subject: | note 7356 deleted from function.ociplogon by sixd | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-161270@lists.php.net to get a copy of this message | ||
Note Submitter: michel at diefirma dot de
----
After hours of weird searching and "try an error"-games with oracle and php I've got
my working system with connection to a remote oracle server. Yeah! Documentation is very bad for
this topic and the posts in all the mailing lists are very confusing. But now...
cheers. it works!
here my working sample code (php4 on debian, oracle 8.1.5.0.2 client, oracle 8i enterprise server on
win2k)
michel
<?php
$user = "scott";
$pass = "tiger";
$tns_name = "my_service_name_in_tnsnames.ora";
// set ORACLE Dir to get the NET8 name resolver working
// tnsnames.ora has to be in $ORACLE_HOME/networking/admin/
putenv("ORACLE_HOME=/home/oracle01/app/oracle/product/8.1.5");
// log on to oracle server using data above
$db_id = OCILogon ($user, $pass, $tns_name);
?>