ID:               46295
 User updated by:  krish dot v at gmail dot com
 Reported By:      krish dot v at gmail dot com
-Status:           Feedback
+Status:           Open
 Bug Type:         OCI8 related
 Operating System: Sun Solaris 8
 PHP Version:      5.2CVS-2008-10-14 (CVS)
 Assigned To:      sixd
 New Comment:

Yes i did. Also i set the env inside the script also..here is my 
script.

<?php^M

putenv("ORACLE_HOME=/oracle/product/9.2.0");
putenv("ORACLE_SID=TESTPRD");
putenv("PATH=$ORACLE_HOME/bin:$PATH");
putenv("LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH");
putenv("TNS_ADMIN=/oracle/admin/network/admin");

// create connection^M
$connection = OCILogon("test","test123");^M
^M
// test connection^M
if (!$connection) {^M
echo "Couldn't make a connection!";^M
exit;^M
}^M
^M
// create SQL statement^M
$sql = "SELECT TNAME, TABTYPE, CLUSTERID FROM TAB";^M
^M
// parse SQL statement^M
$sql_statement = OCIParse($connection,$sql);^M
^M
// execute SQL query^M
OCIExecute($sql_statement);^M
^M
// get number of columns for use later^M
$num_columns = OCINumCols($sql_statement);^M
^M
// start results formatting^M
echo "<TABLE BORDER=1>";^M
echo "<TR><TH>Coffee Name</TH><TH>Roast 
Type</TH><TH>Quantity</TH>";^M
^M
// format results by row^M
while (OCIFetch($sql_statement)){^M
echo "<TR>";^M
for ($i = 0; $i < $num_columns; $i++) {^M
$column_value = OCIResult($sql_statement,$i);^M
echo "<TD>$column_value</TD>";^M
}^M
echo "</TR>";^M
}^M
^M
echo "</TABLE>";^M
^M
// free resources and close connection^M
OCIFreeStatement($sql_result);^M
OCILogoff($connection);^M
?>


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

[2008-10-14 23:11:17] [EMAIL PROTECTED]

Did you make sure to set the Oracle environment (ORACLE_HOME,
ORACLE_SID, ...) BEFORE starting the server and have set proper group
memberships to the web-server user?

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

[2008-10-14 22:33:42] krish dot v at gmail dot com

Description:
------------
Hi,

When connecting to oracle DB. I am getting the below error message.

Warning: ocilogon() [function.ocilogon]: ORA-01034: ORACLE not
available ORA-27101: shared memory realm does not exist SVR4 Error: 2:
No such file or directory in /Application/s1wbsvr61/docs/TestDB.php on
line 10
Couldn't make a connection!

Db is up and running. Also i can able to connect through sqlplus.

And also ORACLE_SID and ORACLE_HOME set.



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


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

Reply via email to