ID:               27696
 Updated by:       [EMAIL PROTECTED]
 Reported By:      gioppo at csi dot it
-Status:           Open
+Status:           Feedback
 Bug Type:         OCI8 related
 Operating System: System  Linux 2.2.19-6.2.1
 PHP Version:      Irrelevant
 Assigned To:      tony2001
 New Comment:

You can install new version in another directory and try it with
PHP-CLI at least, there is no need to touch working installation.




Previous Comments:
------------------------------------------------------------------------

[2004-03-31 03:41:48] gioppo at csi dot it

We cannot, it's a production environment and we cannot change version.

:-(

------------------------------------------------------------------------

[2004-03-31 02:12:23] [EMAIL PROTECTED]

I can't reproduce it neither with PHP4, nor with PHP5.

Have you tried latest versions?

------------------------------------------------------------------------

[2004-03-31 01:22:48] gioppo at csi dot it

Well I think that I've found a workaround.

To test it you can take the code from:

http://php.weblogs.com/adodb

and try a simple connection.

In any case you can try to see what happens if someone compile the
php+OCI using a symbolic link for oracle_home and than uses an absolute
oracle_home.

There could be a bug.

------------------------------------------------------------------------

[2004-03-30 10:03:27] [EMAIL PROTECTED]

So, you've solved it, yes?

This piece of code didn't help me much, just because I can't test it.

------------------------------------------------------------------------

[2004-03-30 09:05:14] gioppo at csi dot it

We probably solved the problem bypassing tnsnames.ora.

We made the connection using tnsnames defined alias and it got errors
sometime.

Here is a chunk of php code (we used method b which gave errors
sometime, when we used d mode we always manage to make connection) any
hint? A problem on finding tnsnames?

NOTE OCILogon is a php library function so no hint on how to modify it,
but the behaviour meke me think about an environment problem:

we have a 

Compile-time ORACLE_HOME  /oracle_home  for compiling OCI for php

but

ORACLE_HOME  /oracle817/app/oracle/product/8.1.7  

_ENV["ORACLE_HOME"] /oracle817/app/oracle/product/8.1.7 

on env for apache and php (/oracle_home  is a symbolic link to the
/oracle817/app/oracle/product/8.1.7 folder) could be that the OCI8 so
compiled have trouble on traversing the link?



/*



  Multiple modes of connection are supported:

  

  a. Local Database

    $conn->Connect(false,'scott','tiger');

  

  b. From tnsnames.ora

    $conn->Connect(false,'scott','tiger',$tnsname); 

    $conn->Connect($tnsname,'scott','tiger'); 

  

  c. Server + service name

    $conn->Connect($serveraddress,'scott,'tiger',$service_name);

  

  d. Server + SID

        $conn->connectSID = true;

        $conn->Connect($serveraddress,'scott,'tiger',$SID);





Example TNSName:

---------------

NATSOFT.DOMAIN =

  (DESCRIPTION =

        (ADDRESS_LIST =

          (ADDRESS = (PROTOCOL = TCP)(HOST = kermit)(PORT = 1523))

        )

        (CONNECT_DATA =

          (SERVICE_NAME = natsoft.domain)

        )

  )

  

  There are 3 connection modes, 0 = non-persistent, 1 = persistent, 2 =
force new connection

        

*/

function _connect($argHostname, $argUsername, $argPassword,
$argDatabasename,$mode=0)

{

       $this->_errorMsg = false;

       $this->_errorCode = false;

                

        if($argHostname) { // added by Jorma Tuomainen
<[EMAIL PROTECTED]>

                if (empty($argDatabasename)) $argDatabasename = $argHostname;

                else {

                        if(strpos($argHostname,":")) {

                                $argHostinfo=explode(":",$argHostname);

                                $argHostname=$argHostinfo[0];

                                $argHostport=$argHostinfo[1];

                        } else {

                                $argHostport="1521";

                        }

                                

                        if ($this->connectSID) {

                                
$argDatabasename="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=".$argHostname

                                
.")(PORT=$argHostport))(CONNECT_DATA=(SID=$argDatabasename)))";

                        } else

                                
$argDatabasename="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=".$argHostname

                                
.")(PORT=$argHostport))(CONNECT_DATA=(SERVICE_NAME=$argDatabasename)))";

                        }

                }

                                

                if ($mode==1) {

                        $this->_connectionID = OCIPLogon($argUsername,$argPassword,
$argDatabasename);

                        if ($this->_connectionID && $this->autoRollback) 
OCIrollback($this->_connectionID);

                } else if ($mode==2) {

                        $this->_connectionID = OCINLogon($argUsername,$argPassword,
$argDatabasename);

                } else {

                        $this->_connectionID = OCILogon($argUsername,$argPassword,
$argDatabasename);

                }

                if ($this->_connectionID === false) return false;

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/27696

-- 
Edit this bug report at http://bugs.php.net/?id=27696&edit=1

Reply via email to