Unable to connect to Oracle DB using PHP script on Linux

liunx

Guest
I have following script:

<?php
include_once('DB.php');

$conninfo = "oci8://Username:passwe@servername:port/SID";
$db = DB::connect($conninfo);

if (DB::isError($db)) {
//print $db->getMessage( );
die($db->getMessage( ));
exit;
}

$result = $db->query("select rownum from dual;");

while ($result->fetchInto($row, DB_FETCHMODE_ASSOC)) {
//print the results..
}

$result->free( );
$db->disconnect( );

?>

When I run this on Linux with PHP (Version: 5.0.4), I get following error "DB Error: connect failed". Do you guys know the possible reason?? Thanks in advance for the help

I am running this from shell prompt like this
/server/httpd-2.0.53/extlib/bin/php /opt/shared/...../test.php

Same script runs fine with MS SQL server connection. Is there some issue with Oracle config?
 
Back
Top