带有消息“找不到驱动程序"的 PostgreSql“PDOException" [英] PostgreSql 'PDOException' with message 'could not find driver'

查看:36
本文介绍了带有消息“找不到驱动程序"的 PostgreSql“PDOException"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

pdo 在 mysql 上工作正常,但在 pgsql 中它给出错误 'PDOException' 并显示消息 'could not find driver' 我已经安装了 php5-pgsql 包,它也包括 pdo_pgsql

最后输入:

[sudo]/etc/init.d/apache2 restart

如果你像我这样使用 apache,要重新启动 apache 服务器...

pdo is working fine with mysql but with pgsql its giving error 'PDOException' with message 'could not find driver' I've installed php5-pgsql package which also includes pdo_pgsql

http://packages.debian.org/sid/php5-pgsql

This package provides a module for PostgreSQL database connections directly from PHP scripts. It also includes the pdo_pgsql module for use with the PHP Data Object extension.

my dsn is pgsql:dbname=DB;host=192.168.0.2 I am using Ubuntu 10.04

解决方案

This message means you need to install and or activate postgresql extension in PHP

This solution works for me : To install postgresql extension

[sudo] apt-get install php-pgsql

after, for activating it, uncomment pgsql and pdo-pgsql extensions in etc/php/$PHP_VERSION/apache2/php.ini file

Finally, type :

[sudo] /etc/init.d/apache2 restart

To restart apache server if you use apache such as was my case...

这篇关于带有消息“找不到驱动程序"的 PostgreSql“PDOException"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆