firebird - codeigniter连接

时间:2014-03-25 09:28:53

标签: php codeigniter firebird firebird2.1

我刚把我的项目从我的笔记本电脑移到本地服务器,这是Linux Fedora。 当我在笔记本电脑上运行时,我的项目运行正常 但当我把它移动到本地服务器 它给了我这个错误。

  

无法使用提供的设置连接到数据库服务器。

     

文件名:core / Loader.php

     

行号:338

我尝试使用本机php ibase_connect 并且它抛出了这个错误

  

无法完成对主机" 192.168.4.141"的网络请求。失败   建立联系。在/var/www/html/connect_firebird.php

这里是config / database.php文件中的db设置

$db['sdisdb']['hostname'] = "192.168.4.141";
$db['sdisdb']['username'] = "sysdba";
$db['sdisdb']['password'] = "masterkey";    
$db['sdisdb']['database'] = "D:\path\to\database.fdb";
$db['sdisdb']['dbdriver'] = "firebird";
$db['sdisdb']['port']    = 3050;
$db['sdisdb']['dbprefix'] = "";
$db['sdisdb']['pconnect'] = FALSE;
$db['sdisdb']['db_debug'] = TRUE;
$db['sdisdb']['cache_on'] = FALSE;
$db['sdisdb']['cachedir'] = "";
$db['sdisdb']['char_set'] = "utf8";
$db['sdisdb']['dbcollat'] = "utf8_general_ci";

我的配置有什么问题?

2 个答案:

答案 0 :(得分:0)

这个

的价值
$db['sdisdb']['database'] = "D:\path\to\database.fdb";

应该是数据库名称

答案 1 :(得分:0)

解决方案:Codeigniter版本3 应用/配置/ database.php中

$db['firebird'] = array(
        'dsn'   => '',
        'hostname' => 'localhost',
        'username' => 'sysdba',
        'password' => 'masterkey',
        'database' => 'C://database.GDB',
        'dbdriver' => 'ibase',
        'dbprefix' => '',
        'pconnect' => FALSE,
        'db_debug' => (ENVIRONMENT !== 'production'),
        'cache_on' => FALSE,
        'cachedir' => '',
        'char_set' => 'ANSI',
        'dbcollat' => 'NONE',
        'swap_pre' => '',
        'encrypt' => FALSE,
        'compress' => FALSE,
        'stricton' => FALSE,
        'failover' => array(),
        'save_queries' => TRUE
);
相关问题