我刚刚将我的项目从笔记本电脑移到了本地服务器上,即Linux Fedora。当我在笔记本电脑上运行时,我的项目运行得很好但当我把它移到本地服务器时它给了我这个错误。
无法使用提供的设置连接到数据库服务器。
文件名:核心/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:pathtodatabase.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";
我的配置有问题吗?
$db['sdisdb']['database'] = "D:pathtodatabase.fdb";
应为数据库名
解决方案: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
);