rathilesh
(Rathilesh C)
June 12, 2013, 6:08am
1
Installed PostgreSQL 9.2 in my system
and am connected successfully in simple php code(means NOT use framwork),But am using in yii get an error
in model generator for gii
CDbConnection failed to open the DB connection: could not find driver
my code is ,
(main.php)
'db'=>array(
'tablePrefix'=>'',
'connectionString' => 'pgsql:host=localhost;port=5432;dbname=my_database',
'username'=>'postgres',
'password'=>'admin',
'charset'=>'UTF8',
),
AM USING XAMPP
IS IT CORRECT ?, IAM REALLY STUCKED please HELP !
try like this,
‘db’=>array(
‘connectionString’ => ‘pgsql:host=localhost;dbname=my_database’,
‘username’ => ‘postgres’,
‘password’ => ‘admin’,
‘tablePrefix’=>‘tbl_’
),
rathilesh
(Rathilesh C)
June 12, 2013, 7:01am
3
kumarkulandai:
try like this,
‘db’=>array(
‘connectionString’ => ‘pgsql:host=localhost;dbname=my_database’,
‘username’ => ‘postgres’,
‘password’ => ‘admin’,
‘tablePrefix’=>‘tbl_’
),
Thank you for your response , I try this code but error are still show
Enabling Postgres Support in PHP
Also make sure PgSQL Support was enabled in the local system by executing phpinfo(), if not enable do the uncomment for the postgres sql support in php.ini file then restart the apache server
extension=php_pgsql.dll
<<REFER ATTACHMENT 1.png >>
Enabling Postgres Support in PDO
Also make sure PgSQL Support was enabled in the local system by executing phpinfo(), if not enable do the uncomment for the postgres sql support in php.ini file then restart the apache server
extension=php_pdo_pgsql.dll
<<REFER ATTACHMENT 2.png >>
rathilesh
(Rathilesh C)
June 12, 2013, 7:16am
5
THANK YOU SO MUCH SIR, Am forgot to enable pdo extension=php_pdo_pgsql.dll , YOU HELPED ME LOT THANK YOU AGAIN
rathilesh
(Rathilesh C)
June 12, 2013, 7:23am
6
HOW can i access remote PostgreSQL db in LAN Connections
You need to specify the ip address for host instead of localhost
‘db’=>array(
‘connectionString’ => ‘pgsql:host=192.168.0.149;dbname=my_database’,
‘username’ => ‘postgres’,
‘password’ => ‘admin’,
‘tablePrefix’=>‘tbl_’
),