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

后端 未结 9 1890
悲&欢浪女
悲&欢浪女 2020-12-09 15:30

pdo is working fine with mysql but with pgsql its giving error \'PDOException\' with message \'could not find driver\' I\'ve installed php5-pgsql p

9条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-09 15:59

    When you do not have postgresql installed on the same machine that is Apache and PHP; you have to install php-pgsql and don't have to add extensions in php.ini manually in Linux (in Windows yes), because redundancies are generated and this does not work (checked in error.log).

    $ sudo apt install php-pgsql
    

    Then you can check the existence of the extension enabled automatically in:

    $ sudo nano /etc/php/7.0/apache2/conf.d/10-pdo.ini
    

    Observations: In phpinfo() you will find the directory conf.d/ and the file error.log

    GL

提交回复
热议问题