2015-11-06 206 views
1

我試圖在ubuntu 10.04和PHP 5.4.37中安裝pdo_pgsql。實際上,postgresql已經安裝並且可以通過phppgadmin正常運行。在Ubuntu10中安裝pdo_pgsql不起作用

現在的問題是缺少pgsql的pdo驅動程序。

我安裝的pgsql PDO,當我輸入PECL安裝pdo_pgsql

# sudo pecl install pdo_pgsql 
`pecl/pdo_pgsql is already installed and is the same as the released version 1.0.2 

而且還增加了在/etc/php5/apache2/conf.d/新pgsql.ini文件 extension=pdo_pgsql

當我運行phpinfo()函數

我能看到

/etc/php5/apache2/conf.d/pgsql.ini, 

Additional .ini files parsed

但我無法看到加載在PDO中的驅動程序,只加載了mysql和sqlite。

其他信息,我從服務器得到的,

PHP Warning: PHP Startup: pdo_pgsql: Unable to initialize module 
Module compiled with module API=20090626 
PHP compiled with module API=20100525 
These options need to match 
in Unknown on line 0 

僅供參考,

即使我嘗試

# sudo apt-get install php5-pgsql 

Reading package lists... Done 
Building dependency tree  
Reading state information... Done 
Some packages could not be installed. This may mean that you have 
requested an impossible situation or if you are using the unstable 
distribution that some required packages have not yet been created 
or been moved out of Incoming. 
The following information may help to resolve the situation: 

The following packages have unmet dependencies: 
    php5-pgsql: Depends: phpapi-20090626 
       Depends: php5-common (= 5.3.2-1ubuntu4.30) but 5.4.37-1+deb.sury.org~lucid+1 is to be installed 
E: Broken packages 

請建議我如何進一步進行。

我甚至重新啓動了Apache和服務器本身。

感謝

+0

試命令和apt-get安裝的php5-pgsql的 –

+0

是的,我試過了,我得到這個消息, 讀取軟件包列表...完成 大廈的依賴關係樹 讀取狀態信息...完成 無法安裝一些軟件包。這可能意味着您有 請求一個不可能的情況,或者如果您正在使用不穩定的 分發版,但尚未創建一些必需的軟件包 或已移出傳入。 下列軟件包有未滿足的依賴關係: 的php5-pgsql的:取決於:phpapi-20090626 取決於:PHP5共用(= 5.3.2-1ubuntu4.30),但5.4.37-1 + deb.sury.org〜清醒+1被安裝 E:破包 –

+0

php5-pgsql需要php 5.4或更高版本,你可以用'sudo apt-get install php-pgsql'來試用它 –

回答

0
apt-get install php5-pgsql 

試試這個

-------------------------------- --------- REMOVE

sudo apt-get purge php5-pgsql 

使用此刪除pgsql 靠什麼PHP與嘗試php5-pgsqlphp-pgsqlphp4-pgsql

+0

實際上pgsql被編譯到錯誤的文件夾中。其實我從phpinfo()得到了這個:PHP Extension => 20100525和PHP Extension Build => API20100525,NTS。但是pgsql安裝在API = 20090626中。我不確定如何編譯回20100525? –

+0

爲什麼你不使用新安裝的Ubuntu?清潔。並重新安裝所有包 – Ramy

+0

哦..這是不可能的。我在那裏跑了20個網站。 –