2015-11-06 201 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个网站。 –