Php startup: unable to load dynamic library pdo_pgsql

Upgrded this week from MAMP/MAMP Pro 5.7.x to MAMP 6.0.1. Since then I've been seeing the following in my /Applications/MAMP/logs/php_error.log

I've tried reinstalling the PHP 7.4.9 version. No luck.

I'm not even using this PHP version. I'm using PHP 7.4.10 as my default versions and this is used by all 6 of my sites.

I've also enabled this PHP version then edited the php.ini and disabled the call to load this library. Restart MAMP and no luck.

[05-Nov-2020 17:54:17 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'pgsql.so' (tried: /Applications/MAMP/bin/php/php7.4.9/lib/php/extensions/no-debug-non-zts-20190902/pgsql.so (dlopen(/Applications/MAMP/bin/php/php7.4.9/lib/php/extensions/no-debug-non-zts-20190902/pgsql.so, 9): Library not loaded: /Applications/MAMP/Library/pg/lib/libpq.5.dylib

Referenced from: /Applications/MAMP/bin/php/php7.4.9/lib/php/extensions/no-debug-non-zts-20190902/pgsql.so

Reason: image not found), /Applications/MAMP/bin/php/php7.4.9/lib/php/extensions/no-debug-non-zts-20190902/pgsql.so.so (dlopen(/Applications/MAMP/bin/php/php7.4.9/lib/php/extensions/no-debug-non-zts-20190902/pgsql.so.so, 9): image not found)) in Unknown on line 0

PHP Core Warning 'yii\base\ErrorException' with message 'PHP Startup: Unable to load dynamic library 'pdo_pgsql.so' (tried: /Applications/MAMP/bin/php/php7.3.1/lib/php/extensions/no-debug-non-zts-20180731/pdo_pgsql.so (dlopen(/Applications/MAMP/bin/php/php7.3.1/lib/php/extensions/no-debug-non-zts-20180731/pdo_pgsql.so, 9): Library not loaded: /Applications/MAMP/Library/pg/lib/libpq.5.dylib
Referenced from: /Applications/MAMP/bin/php/php7.3.1/lib/php/extensions/no-debug-non-zts-20180731/pdo_pgsql.so
Reason: image not found), /Applications/MAMP/bin/php/php7.3.1/lib/php/extensions/no-debug-non-zts-20180731/pdo_pgsql.so.so (dlopen(/Applications/MAMP/bin/php/php7.3.1/lib/php/extensions/no-debug-non-zts-20180731/pdo_pgsql.so.so, 9): image not found))'

EDIT:

0
Votes
I can’t solve this problem so I banned it

;extension=pdo_pgsql.so

I use mysql :)

MAMP Support Forums is an unofficial support forum covering MAMP & MAMP Pro solution stacks.

My development machine is currently a MacBook Pro Core2Duo. It also happens to use a 64bit architecture. My previous machine was a MacBook Pro CoreDuo which was 32bit.

  1. Php Startup%3a Unable To Load Dynamic Library Macro
  2. Php Startup Unable To Load Dynamic Library Mac
  3. Php Startup%3a Unable To Load Dynamic Library Machine
  4. Php Startup%3a Unable To Load Dynamic Library Mac

Compiling a simple dynamic extension for PHP became something of an issue when moving on to the newer MBP.

PHP: Unable to load dynamic library gd Posted 2013-03-01 with tags linux, PHP, LAMP. I installed lang/php74-extensions After php -m I get the following messages: PHP Warning: PHP Startup: Unable to load dynamic library 'mysql.so' (tried. PHP Startup: Unable to load dynamic library 'phpcurl.dll' Submitted: 2018-09-16 13:33 UTC: Modified: 2018-10-06 14:52 UTC: From: masterwto at 163 dot com: Assigned. 'PHP Warning: PHP Startup: Unable to load dynamic library 'D: Program Files PHP ext phpmysqli.dll' - Invalid access to memory location. R in Unknown on line 0' This one is a bug in MySQL 5.0.41 that prevents libmysql.dll being loaded correctly.You have to use the libmysql.dll supplied with PHP rather than the one supplied with MySQL.

I was trying to install the RAR extension for PHP on my dev laptop to test a few unrelated bits and I got mired in the process of getting this damned extension to load for Apache. My error logs, enabled just to debug this process, were filling up with:

PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/extensions/no-debug-non-zts-20060613/rar.so’ – (null) in Unknown on line 0

Every page that describes the process had the same steps. Get archive. Untar, ./configure, make, make install, make test, add extension=rar.so. Blah blah blah. One typical test was to run the CLI version of PHP and confirm that the dynamic extension was loading and was not causing startup errors:

php -i | grep rar

or

php -m | grep rar

Yep. No problems. I could even run tests like:

php -r “echo rar_open(‘myRar.rar’);”

The above would give me the internal ID for the rar object handle. Great! I was in business. However, after bouncing Apache 2, my phpinfo() page failed to show RAR as a loaded extension. The above impromtu tests confirmed that the proper modifications to php.ini and paths to my extensions_dir were correctly set. WTF?

Doing some serious googling, I stumbled on a thread off of Marc Liyanage’s invaluable Mac OS X PHP site entropy.ch: http://www.entropy.ch/phpbb2/viewtopic.php?t=2877

MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS=”-arch x86_64 -g -Os -pipe -no-cpp-precomp” CCFLAGS=”-arch x86_64 -g -Os -pipe” CXXFLAGS=”-arch x86_64 -g -Os -pipe” LDFLAGS=”-arch x86_64 -bind_at_load” ./configure

To sum it up in one line, compiling a dynamic extension for PHP may default to a 32bit architecture. This will fail when PHP as a DSO for Apache 2 is compiled against 64bit libs.

The punchline? RAR now loads for Apache as intended and works a charm. The CLI version complains every time I invoke it :).

Upgrded this week from MAMP/MAMP Pro 5.7.x to MAMP 6.0.1. Since then I've been seeing the following in my /Applications/MAMP/logs/php_error.log
I've tried reinstalling the PHP 7.4.9 version. No luck.
I'm not even using this PHP version. I'm using PHP 7.4.10 as my default versions and this is used by all 6 of my sites.

I've also enabled this PHP version then edited the php.ini and disabled the call to load this library. Restart MAMP and no luck.
[05-Nov-2020 17:54:17 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'pgsql.so' (tried: /Applications/MAMP/bin/php/php7.4.9/lib/php/extensions/no-debug-non-zts-20190902/pgsql.so (dlopen(/Applications/MAMP/bin/php/php7.4.9/lib/php/extensions/no-debug-non-zts-20190902/pgsql.so, 9): Library not loaded: /Applications/MAMP/Library/pg/lib/libpq.5.dylib

Php startup: unable to load dynamic library pdo_pgsql

Referenced from: /Applications/MAMP/bin/php/php7.4.9/lib/php/extensions/no-debug-non-zts-20190902/pgsql.so
Reason: image not found), /Applications/MAMP/bin/php/php7.4.9/lib/php/extensions/no-debug-non-zts-20190902/pgsql.so.so (dlopen(/Applications/MAMP/bin/php/php7.4.9/lib/php/extensions/no-debug-non-zts-20190902/pgsql.so.so, 9): image not found)) in Unknown on line 0

Php Startup Unable To Load Dynamic Library Mac

PHP Core Warning 'yiibaseErrorException' with message 'PHP Startup: Unable to load dynamic library 'pdo_pgsql.so' (tried: /Applications/MAMP/bin/php/php7.3.1/lib/php/extensions/no-debug-non-zts-20180731/pdo_pgsql.so (dlopen(/Applications/MAMP/bin/php/php7.3.1/lib/php/extensions/no-debug-non-zts-20180731/pdo_pgsql.so, 9): Library not loaded: /Applications/MAMP/Library/pg/lib/libpq.5.dylib
Referenced from: /Applications/MAMP/bin/php/php7.3.1/lib/php/extensions/no-debug-non-zts-20180731/pdo_pgsql.so

Php Startup%3a Unable To Load Dynamic Library Machine

Reason: image not found), /Applications/MAMP/bin/php/php7.3.1/lib/php/extensions/no-debug-non-zts-20180731/pdo_pgsql.so.so (dlopen(/Applications/MAMP/bin/php/php7.3.1/lib/php/extensions/no-debug-non-zts-20180731/pdo_pgsql.so.so, 9): image not found))'

Php Startup%3a Unable To Load Dynamic Library Mac

EDIT:
0
Votes
I can’t solve this problem so I banned it
;extension=pdo_pgsql.so
I use mysql :)