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 installed lang/php74-extensions After php -m I get the following messages: PHP Warning: PHP Startup: Unable to load dynamic library 'mysql.so' (tried.
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 '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
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 :)
Update 20/04/2020: I just realised there were a couple of mistakes and have corrected it. Also updated to note of my system specification
Notice: This was done on a Ubuntu 16.04 machine with PHP 7.2 and NGINX. If you're using other configs, it might or might not work.
Earlier*, I encountered an annoying problem with one of PHP's extension, PHP GD. No matter how many times or what version of PHP GD I installed, PHP always prints the following warning:
PHP Warning: PHP Startup: Unable to load dynamic library 'gd.so' (tried: /usr/lib/php/20170718/gd.so (/usr/lib/php/20170718/gd.so: undefined symbol: gdImageCreateFromWebp), /usr/lib/php/20170718/gd.so.so (/usr/lib/php/20170718/gd.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Php Startup%3a Unable To Load Dynamic Library Mac
Thanks to this, here's how I fixed it for PHP7.2-FPM:
- Remove PHP GD including any reference/config to it. Run
sudo apt purge php7.2-gd
. - Reinstall the extension:
sudo apt update && sudo apt install php7.2-gd
. - Make sure
gd.ini
exist in your PHP 'mods-available' directory. For most, that would be at/etc/php/7.2/mods-available
. If not, create it with the following content: - Go to
/usr/local/lib
. The culprits are the multiple libgd*.so files. There's only supposed to be one, that islibgd.so
.
- Either delete the files in red, or move them to a backup folder, leaving only
libgd.so
. - Restart both PHP and NGINX:
service php7.2-fpm restart && service nginx restart
- Verify that it's enabled and loaded by PHP:
Php Startup%3a Unable To Load Dynamic Library Macro
* Actually the warning for it have appeared since several months ago, I just didn't have time to take a look at it, since it didn't break anything.