2016-07-29 113 views
0

我在Oracle和fuelphp,简单的问题,新的,如何设置Oracle数据库连接fuelphp框架,文件只针对MySQL和PostgreSQL:如何连接加速器与oracle?

// a MySQL driver configuration 
'development' => array(
'type'   => 'mysqli', 
'connection'  => array(
    'hostname'  => 'localhost', 
    'port'   => '3306', 
    'database'  => 'fuel_db', 
    'username'  => 'your_username', 
    'password'  => '[email protected]', 
    'persistent'  => false, 
    'compress'  => false, 
), 
'identifier'  => '`', 
'table_prefix' => '', 
'charset'  => 'utf8', 
'enable_cache' => true, 
'profiling'  => false, 
'readonly'  => false, 
), 

// a PDO driver configuration, using PostgreSQL 
'production' => array(
'type'   => 'pdo', 
'connection'  => array(
    'dsn'   => 'pgsql:host=localhost;dbname=fuel_db', 
    'username'  => 'your_username', 
    'password'  => '[email protected]', 
    'persistent'  => false, 
    'compress'  => false, 
), 
'identifier'  => '"', 
'table_prefix' => '', 
'charset'  => 'utf8', 
'enable_cache' => true, 
'profiling'  => false, 
'readonly'  => array('slave1', 'slave2', 'slave3'), 
) 

如何与Oracle连接?谢谢

回答

0

来自PostgreSQL PDO例如工作你贴我也试试这个:

'production'  => array(
'type'   => 'pdo', 
'connection'  => array(
    'dsn'   => 'oci:dbname=//hostname:port/database', 
    'username'  => 'your_username', 
    'password'  => '[email protected]', 
    'persistent'  => false, 
    'compress'  => false, 
), 
'identifier'  => '"', 
'table_prefix' => '', 
'charset'  => 'utf8', 
'enable_cache' => true, 
'profiling'  => false, 
'readonly'  => false 
) 

只要确保你已经correctly installed & configured PHP的OCI驱动程序。