2012-09-03 36 views
-1

我在使用代码生成与PostgreSQL数据库的问题,我已经作出main.php配置.. ...不能使代码生成与PostgreSQL的

'modules'=>array(

    'gii'=>array(
     'class'=>'system.gii.GiiModule', 
     'password'=>'123wasis85', 
     'ipFilters'=>array('127.0.0.1','::1'), 
    ), 

), 

...

'db'=>array(
     'connectionString' => 'pgsql:host=127.0.0.1;port=5432;dbname=yii_first', 

      'emulatePrepare' => true, 

      'username' => 'postgres', 

      'password' => 'anghauz', 

      'charset' => 'utf8', 
     ), 

...

但它仍然使错误结果当我用CRUD的产生,这是错误..:

...

CDbConnection failed to open the DB connection: could not find driver 

C:\BitNami\apache2\htdocs\yii\framework\gii\generators\crud\CrudCode.php(44) 

...

我让它在本地主机N使用bitnami ..

请帮我家伙的解决方案..

+0

请帮帮我吧! –

+4

那么你是否安装了php/yii的相关PostgreSQL驱动?哦,它是Postgres或PostgreSQL从不“Postgre”。 –

回答

3

请到PHP。 ini文件在安装的php文件夹中。取消注释以下行。

extension=php_pdo_pgsql.dll 
extension=php_pgsql.dll 

它为我工作。

+0

只需启用PDO扩展就可以为我工作 – iGbanam