2013-12-19 27 views
0

在取消「延長= php_pdo_pgsql.dll」和「延長= php_pgsql.dll」我不斷收到錯誤PGSQL擴展Yii中仍然即使在php.ini

CDbConnection failed to open the DB connection: could not find driver 
後「警告」

即使在取消「後延= php_pdo_pgsql.dll 「和」 延長= php_pgsql.dll並重新啓動WAMP。

的Yii的要求檢查仍顯示PDO PostgreSQL擴展爲 「警告」。

這裏是我的代碼片段

'db'=>array(
    'tablePrefix' => '', 
    'connectionString' => 'pgsql:host=localhost;port=5432;dbname=myDB', 
    'username'=>'postgres', 
    'password'=>'postgresql', 
    'charset'=>'UTF8', 
), 

我使用

的Yii 1.1.14 WAMP 2.4 PHP 5.4.12

+1

http://stackoverflow.com/questions/551734/php-not-loading-php-pgsql-dll-on-windows –

+0

替代解釋http://blog.lysender.com/2010/08/php-和PostgreSQL相關的窗口/ – topher

回答

0

我發現這個解決方案的地方,對我的作品

假設你已經安裝PostgreSQL和你的WAMP安裝在c:\ wamp上,您需要將c:\ wamp \ bin \ php \ php5.3.9 \ libpq.dll拷貝到c:\ wamp \ bin \ apache \ Apache2.2.11 \ bin 當然你也有下列文件 C:\ WAMP \ BIN \ PHP \ php5.3.9 \分機\ php_pdo_pgsql.dll和 C:\ WAMP \ BIN \ PHP \ php5.3.9 \分機\ php_pgsql.dll

此外,還要確保你通過WAMP菜單啓用上述2個文件(點擊任務欄上的WAMP圖標,PHP,PHPExtensions,找到上面的2並'檢查'它們)

請注意php5.3.9和Apache2.2.11請參閱我的特定PHP和Apache版本。 調整以適應您的安裝。

就是這樣!