Score:0

How to install PHP pdo_pgsql driver version 13.3 on Ubuntu 18.04

us flag

I have successfully installed some time ago a default installation of PHP 7.4 and of Postgresql v10 on my Ubuntu 18.04 LTS server.

Today I need to update my Postgresql version to 13.3 - but can't quite figure out how to get there.

  • I have PHP v7.4.20 installed and running successfully
  • Postgresql v13.3 is also installed and running successfully
    $ psql --version  
    psql (PostgreSQL) 13.3 (Ubuntu 13.3-1.pgdg18.04+1)
  • However PHPinfo lists the PDO_Pgsql driver version in use as v10 phpinfo

[Edit] The problem I'm facing occurs while trying to install an internally-developed application, during composer install --no-dev :
enter image description here

The app developer has validated the app for PGSQL v13.2+

=> How can I upgrade the version of PHP pdo_pgsql driver ?

in flag
Unless you are using some bleeding edge features, you shouldn't *need* to change your version of the `pdo_pgsql` driver. It will works with PostgreSQL versions 5.x ~ 12+ (I'm using this same version with a PostgreSQL 12.3 database, which I'll admit is not 13.x, but still). Are you seeing any particular errors when you try to connect or run queries?
caccia avatar
us flag
@matigo I get an error in the postinstall phase of running `composer install`. >In Exception.php line 18: could not find driver >In PDOConnection.php line 38: could not find driver >Script @auto-scripts was called via post-install-cmd While checking some more , we have a line in `doctrine.yaml` setting `server_version: 13.3` This was added by the developer to fix some issues, but not sure what exactly.
caccia avatar
us flag
Actually it looks like my problem lies not with the PHP driver, but with the PSQL installation itself... My Psql *client* is v13.3 but a `show server_version` shows that the *server* version is the old v10... I'll look into that!!
caccia avatar
us flag
Running around in circles... I've gotten the server_version up to `13.3 (Ubuntu 13.3-1.pgdg18.04+1)`. However PHP PDO_pgsql still uses v10.17 according to phpinfo. @matigo - I've added the message from the initial error, which leads me to this PDO driver (could be wrong of course). If you have any suggestions... ?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.