0

I have been having an issue in yii2 deployment . My System keeps returning an error message from time to time when api functions are called. Any ideas on how to solve this will be appreciated.

   name "PHP Core Warning"
   message:PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/pgsq' - /usr/lib/php/20151012/pgsq: cannot open shared object file: No such file or directory
   code 32
   type "yii\\base\\ErrorException"
   file "Unknown"
   line 0
   stack-trace  [ "#0 [internal function]: yii\\base\\ErrorHandler->handleFatalError()", "#1   
   {main}" ]
   0    "#0 [internal function]: yii\\base\\ErrorHandler->handleFatalError()"
   1    "#1 {main}"

fr

Nges Brian
  • 479
  • 1
  • 8
  • 22
  • Does the directory or file exist? – Code Spirit May 25 '21 at 11:17
  • i Searched and it does not exist. – Nges Brian May 25 '21 at 11:26
  • 1
    Then it seems your server does not have it installed or it is in a diffrent path. – Code Spirit May 25 '21 at 11:32
  • Does this answer your question? [PHP Warning: PHP Startup: Unable to load dynamic library](https://stackoverflow.com/questions/5282264/php-warning-php-startup-unable-to-load-dynamic-library) – Code Spirit May 25 '21 at 11:33
  • @CodeSpirit no. the issue is that I don't even have any library like pgsq. I have commented out pdo_pgsql etc but It isn't working. I don't even know which package is pgsq because I haven't seen it before. – Nges Brian May 25 '21 at 13:47
  • 1
    There can be multiple config files for php and it is common that people change the wrong ones (use `php --ini` or `phpinfo()` to find them). pgsql is PHPs library for PostgreSQL and the message shows that you still try to load it in your ini. – Code Spirit May 25 '21 at 14:06
  • how do I know I know the right file to change because when I use php --ini, I see so many files – Nges Brian May 26 '21 at 15:37
  • Check [PHP - The configuration file](https://stackoverflow.com/questions/5282264/php-warning-php-startup-unable-to-load-dynamic-library) for info. All files work but you have to consider in which order they are loaded (php.ini first and then in alnum order). – Code Spirit May 26 '21 at 16:21
  • I actually discovered that the issue is bigger than I thought. I can't install anything using apt-get or dpkg. when I run php -v for example, I get a clear warning to my error PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_pgsql' (tried: /usr/lib/php/20170718/pdo_pgsql (/usr/lib/php/20170718/pdo_pgsql: cannot open shared object file: No such file or directory), /usr/lib/php/20170718/pdo_pgsql.so (/usr/lib/php/20170718/pdo_pgsql.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 but I don't still know how to fix this. have been googling around – Nges Brian May 26 '21 at 16:26

0 Answers0