|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-10-14 22:33 UTC] 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. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 04:00:01 2025 UTC |
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 ?>