PostgreSql 'PDOException' with message 'could not find driver' PostgreSql 'PDOException' with message 'could not find driver' postgresql postgresql

PostgreSql 'PDOException' with message 'could not find driver'


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

enter image description here

Finally, type :

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

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


1) Have you enabled pgsql.so in php.ini (extension=pgsql.so)?

2) Is you Postgresql listenin on 192.168.0.2 interface? (You can check it by netstat -tpln)

3) How you authenticate your access into Postgresql?


Make sure you've uncommented the line that tells php where the Postgres driver is (usually extension=pgsql.so) in the main php.ini file.