How to Connect to Remote Oracle 8i In PHP4?
| From: | Edward Wong | Date: | Tue, 29 Jun 1999 06:59:37 +0000 |
| Subject: | How to Connect to Remote Oracle 8i In PHP4? | ||
| Groups: | php.db php.general | ||
| Request: | Send a blank email to php-general+get-3742@lists.php.net to get a copy of this message | ||
My Oracle 8i is installed on another server ( Solaris 2.8),
and my workstation is windows 2000, when I use the following code
tring to connect to the oracle, browser reports error saying:
" Warning: Unable to connect to ORACLE ()."
But I can connect to it with SQL_Plus and other tools also works well.
What's the problem?
How to put env to Oracle_Home? I installed oracle 8i client to D:\Oracle\Ora81
<?php
putenv("ORACLE_SID=SOLARIS");
putenv("ORACLE_HOME=D:\\Oracle\\Ora81");
$handle = ora_plogon("SCOTT/TIGER@192.168.0.100:1521", "") or die;
$cursor = ora_open($handle);
ora_commitoff($handle);
$query = "SELECT * FROM EMP";
ora_parse($cursor, $query) or die;
ora_exec($cursor);
................
?>