how to connect Oracle using PEAR(DB_DataObject)?
Posted: Sun Jun 28, 2009 8:54 pm
Hi all,
I installed a Oracle 10.2.0.1 in host, and in my develop machine i installed a oracle client.
i can use general php code to connect oracle:
now, how can i use PEAR(such DB_DataObject) to connect it. i create a confige ini file, but it seems can not work.
[DB_DataObject]
database = oci8://SYSTEM:1234@192.168.1.111:1521/dbserver
schema_location = E:/codephp/oracle/database/dataobjects/schema
class_location = E:/codephp/oracle/database/dataobjects
require_prefix = E:/codephp/oracle/database/dataobjects
class_prefix = DataObjects_
extends_location = DB/DataObject.php
extends = DB_DataObject
please help me, thanks a lot.
I installed a Oracle 10.2.0.1 in host, and in my develop machine i installed a oracle client.
i can use general php code to connect oracle:
Code: Select all
function php_conn_ora(){
$username='SYSTEM';
$passwd='1234';
$protocol='TCP';
$SERVICE_NAME='dbserver';
$ORACLE_SERVER_IP_ADDRESS='192.168.1.111';
$Port='1521';
PutEnv("NLS_LANG=SIMPLIFIED CHINESE_CHINA.AL32UTF8");
if(!$conn = oci_pconnect($username, $passwd, "(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = $protocol)(HOST = $ORACLE_SERVER_IP_ADDRESS)(PORT = $Port)) ) (CONNECT_DATA = (SERVICE_NAME = $SERVICE_NAME) ) )")) echo("Error in Connecting to DataBase");
return $conn;
}[DB_DataObject]
database = oci8://SYSTEM:1234@192.168.1.111:1521/dbserver
schema_location = E:/codephp/oracle/database/dataobjects/schema
class_location = E:/codephp/oracle/database/dataobjects
require_prefix = E:/codephp/oracle/database/dataobjects
class_prefix = DataObjects_
extends_location = DB/DataObject.php
extends = DB_DataObject
please help me, thanks a lot.