I had compile PHP with oracle using the --with oci8 and all went well during compilation and installation.....
but when i try the test script it show the error below....
Error Message
connection to Chess Development server ......12
Warning: ocilogon() [function.ocilogon (http://IP ADDRESS OF MY SERVER//function.ocilogon) ]: _oci_open_session: OCIHandleAlloc OCI_HTYPE_SVCCTX: OCI_INVALID_HANDLE in /usr/local/apache/htdocs/test_ora.php on line 8
Test code
<?
function connect_ora($host='10.8.1.92',$sid='ch320',$dbase='chess_prd',$password='manager')
{
$connect = " (DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = $host)(PORT = 1521))
(CONNECT_DATA = (SID = $sid)) )";
$cur = ocilogon("$dbase","$password",$connect);
if ($cur == false)
{echo "<h2>Failed Connection To Chess...Please Try Later. </h2>".OCIError($connection)."";
exit;}
return $cur;
}
// connect to development server
echo "<b>connection to Chess Development server ...... </b> ";
$cur = connect_ora("w.x.y.z","ABC");
echo " <b>OK</b>";
$sql = "select * from c_fpo_mc_type where MACHINE_TYPE='xx'";
echo "<br>Execute SQL : $sql ......";
$stmt = OCIParse($cur,$sql);
if (OCIExecute($stmt, OCI_DEFAULT))
{echo " <b>OK</b><br>"; }
OCILogoff($cur);
echo "<br><b>Log Off from Live server ...... </b> ";
?>