欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

请问,kohana框架下如何连接oracle数据库,谢谢

程序员文章站 2022-05-16 14:09:32
...
请问,kohana框架下如何用框架里面的pdo连接oracle数据库,谢谢
用原生态的tns可以


回复讨论(解决方案)

搞定
;extension=php_pdo_oci.dll
;extension=php_pdo_oci8.dll
这2个服务都要打开
用Kohana框架下的Pdo_oci连接代码示例:
'test' => array
(
'type' => 'PDO',
'connection' => array(
/**
* The following options are available for MySQL:
*
* string hostname server hostname, or socket
* string database database name
* string username database username
* string password database password
* boolean persistent use persistent connections?
* array variables system variables as "key => value" pairs
*
* Ports and sockets may be appended to the hostname.
*/
'dsn' => 'oci:dbname=//xxx.xxx.xxx.xx',
'hostname' => 'hostname',
'database' => 'database name',
'username' => 'username',
'password' => 'password',
'persistent' => FALSE,
),
'table_prefix' => '',
'charset' => 'gb2312',
'caching' => FALSE,
'profiling' => TRUE,
)