Reputation: 247
I have Firebird database file Twenty.FDB
. Previously it was located in C:\db folder and I was using path as 'database' => 'C:\db\Twenty.FDB'
and it was working fine.
Now I want to upload my codeigniter webservices on server and want to set its path as /db/Twenty.FDB. Following are changes that I have done but it is not working for me. My question is can I use relative path or have I only choice to use absolute path.
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => 'sysdba',
'password' => 'masterkey',
'database' => '/db/Twenty.FDB',
'dbdriver' => 'ibase',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'NONE',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
Upvotes: 0
Views: 435
Reputation: 4582
Use FCPATH, because without FCPATH CodeIgniter thinks you are trying to reference a db directory off of root.
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => 'sysdba',
'password' => 'masterkey',
'database' => FCPATH . 'db/Twenty.FDB',
'dbdriver' => 'ibase',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'NONE',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
Upvotes: 2