title: php pdo_pgsql file present but not recognized
body: <p>Running a DigitalOcean droplet on Ubuntu (20.4?)</p>
  <p>I have userA with root permission. They are also connected to userA within the postgres db.</p>
  <p>Due to the setup for the software I'm using, they require a specific username for the postgresdb. Just so I'm not exposing too much data online, we'll call that userB. That's both a linux and postgres user.</p>
  <p>I'm running a php command that basically takes (uname, dbname, pdo, options) as input, and it's currently failing bc it can't locate the pdo file.</p>
  <p>I've looked through a few posts. One suggested to uncomment all of the pgsql and pdo_pgsql lines in all of the php.ini files, which i've done, both for production, development, and the generic version of that file.</p>
  <p>When I run the command as both userA and userB I get this error.</p>
  <pre><code>PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo_pgsql' (tried: /usr/lib/php/20190902/pdo_pgsql (/usr/lib/php/20190902/pdo_pgsql: cannot open shared object file: No such file or directory), /usr/lib/php/20190902/pdo_pgsql.so (/usr/lib/php/20190902/pdo_pgsql.so: undefined symbol: pdo_parse_params)) in Unknown on line 0
  </code></pre>
  <p>However, pdo_pgsql.so actually does exist in that location. (is it looking for a file just named pdo_pgsql and is instead finding pdo_pgsql.so?)</p>
  <p>The php site says to run a</p>
  <pre><code>./configure
  </code></pre>
  <p>command, but it doesn't really say which folder configure is in. It's not a package I can install from cli. (<a href="https://www.php.net/manual/en/ref.pdo-pgsql.php" rel="nofollow noreferrer">https://www.php.net/manual/en/ref.pdo-pgsql.php</a>)</p>
  <p>Other pages say you have to install autoconf first (<a href="https://unix.stackexchange.com/questions/158960/can-not-run-configure-command-no-such-file-or-directory">https://unix.stackexchange.com/questions/158960/can-not-run-configure-command-no-such-file-or-directory</a>) however that has not made ./configure an available command for me.</p>
  <p>I've also found a post saying that a conf file in apache needs to be updated to show the location of the PDO file, however I'm not yet running a server, I'm just running a php file that populates a pgsql db locally. (<a href="https://stackoverflow.com/questions/45675974/pgsql-extension-is-not-loading">pgsql extension is not loading</a>)</p>
  <p>Running</p>
  <pre><code>php -i | grep PDO
  </code></pre>
  <p>gives</p>
  <pre><code>PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo_pgsql' (tried: /usr/lib/php/20190902/pdo_pgsql (/usr/lib/php/20190902/pdo_pgsql: cannot open shared object file: No such file or directory), /usr/lib/php/20190902/pdo_pgsql.so (/usr/lib/php/20190902/pdo_pgsql.so: undefined symbol: pdo_parse_params)) in Unknown on line 0
  PDO
  PDO support =&gt; enabled
  PDO drivers =&gt; pgsql
  PDO Driver for PostgreSQL =&gt; enabled
  </code></pre>
  <p>Though according to customer service from the API it should be returning</p>
  <pre><code>PDO
  PDO support =&gt; enabled
  PDO drivers =&gt; mysql, odbc, pgsql
  PDO Driver for MySQL =&gt; enabled
  PDO Driver for ODBC (unixODBC) =&gt; enabled
  PDO Driver for PostgreSQL =&gt; enabled
  </code></pre>
  <p>Though I think they're giving multiple examples of different drivers depending on your db software of choice.</p>
  <p>I'm not exactly sure what to do.</p>
  <p>Update:</p>
  <p>I've tried editing the php.ini file that is being used by php via</p>
  <pre><code>php -i | grep ini
  </code></pre>
  <p>I used</p>
  <pre><code>locate pdo_pgsql
  </code></pre>
  <p>to find the pdo_pgsql and pdo_pgsql.so filepaths. I have tried 4 different edits to the php.ini file. 2 being uncommenting (one at a time) the default pgsql extensions. 2 being different filepaths to the pdo_pgsql files that are found on my system through locate.</p>
  <pre><code>**extension=/usr/lib/php/20190902/pdo_pgsql.so**
  
  sudo php file.php
  
  PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20190902/pdo_pgsql.so' (tried: /usr/lib/php/20190902/pdo_pgsql.so (/usr/lib/php/20190902/pdo_pgsql.so: **undefined symbol: pdo_parse_params**), /usr/lib/php/20190902//usr/lib/php/20190902/pdo_pgsql.so.so (/usr/lib/php/20190902//usr/lib/php/20190902/pdo_pgsql.so.so: **cannot open shared object file: No such file or directory**)) in Unknown on line 0
  
  **extension=/var/lib/php/modules/7.4/registry/pdo_pgsql**
  
  sudo php file.php
  
  PHP Warning:  PHP Startup: Unable to load dynamic library '/var/lib/php/modules/7.4/registry/pdo_pgsql' (tried: /var/lib/php/modules/7.4/registry/pdo_pgsql (/var/lib/php/modules/7.4/registry/pdo_pgsql: **file too short**), /usr/lib/php/20190902//var/lib/php/modules/7.4/registry/pdo_pgsql.so (/usr/lib/php/20190902//var/lib/php/modules/7.4/registry/pdo_pgsql.so: **cannot open shared object file: No such file or directory)**) in Unknown on line 0
  Could not open input file: file.php
  
  **extension=pgsql**
  
  sudo php file.php
  
  **PHP Warning:  Module 'pgsql' already loaded in Unknown on line 0**
  Could not open input file: file.php
  
  **extension=pdo_pgsql**
  
  sudo php file.php
  
  PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo_pgsql' (tried: /usr/lib/php/20190902/pdo_pgsql (/usr/lib/php/20190902/pdo_pgsql: **cannot open shared object file: No such file or directory**), /usr/lib/php/20190902/pdo_pgsql.so (/usr/lib/php/20190902/pdo_pgsql.so: **undefined symbol: pdo_parse_params**)) in Unknown on line 0
  Could not open input file: file.php
  </code></pre>
  <p>output as requested by user below</p>
  <pre><code>$ php -v
  PHP 7.4.3 (cli) (built: Mar  2 2022 15:36:52) ( NTS )
  Copyright (c) The PHP Group
  Zend Engine v3.4.0, Copyright (c) Zend Technologies
      with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies
  
  $ dpkg -l|grep pgsql
  ii  php-pgsql                       2:7.4+75                           all          PostgreSQL module for PHP [default]
  ii  php7.4-pgsql                    7.4.3-4ubuntu2.10                  amd64        PostgreSQL module for PHP
  
  $ dpkg -l|grep php
  ii  php-common                      2:75                               all          Common files for PHP packages
  ii  php-pgsql                       2:7.4+75                           all          PostgreSQL module for PHP [default]
  ii  php7.4-cli                      7.4.3-4ubuntu2.10                  amd64        command-line interpreter for the PHP scripting language
  ii  php7.4-common                   7.4.3-4ubuntu2.10                  amd64        documentation, examples and common module for PHP
  ii  php7.4-json                     7.4.3-4ubuntu2.10                  amd64        JSON module for PHP
  ii  php7.4-opcache                  7.4.3-4ubuntu2.10                  amd64        Zend OpCache module for PHP
  ii  php7.4-pgsql                    7.4.3-4ubuntu2.10                  amd64        PostgreSQL module for PHP
  ii  php7.4-readline                 7.4.3-4ubuntu2.10                  amd64
  </code></pre>