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
Best Answer
This message means you need to install and or activate postgresql extension in PHP
This solution works for me : To install postgresql extension
after, for activating it, uncomment
pgsql
andpdo-pgsql
extensions inetc/php/$PHP_VERSION/apache2/php.ini
fileFinally, type :
To restart apache server if you use apache such as was my case...