firebird - codeigniter connection

断了今生、忘了曾经 提交于 2019-12-14 02:44:06

问题


i just moved my project from my laptop to the local server, which is Linux Fedora. my project was working fine when i run it on my laptop but when i moved it to the local server it gave me this error.

Unable to connect to your database server using the provided settings.

Filename: core/Loader.php

Line Number: 338

i tried using native php ibase_connect and it's throwing this error

Unable to complete network request to host "192.168.4.141". Failed to establish a connection. in /var/www/html/connect_firebird.php

here's the db setting in config/database.php file

$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";

anything wrong with my config?


回答1:


the value of this

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

should be database name




回答2:


Solution: Codeigniter version 3 application/config/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
);


来源:https://stackoverflow.com/questions/22630271/firebird-codeigniter-connection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!