PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20160303/gd2' - sockets

I recently bought a new Macbook pro with php 7.1 installed and everything was working fine since I tried to upgrade php to 7.2 using homebrew. When I try to show my version of php with php -v, and it works but it returns me the following warnings :
PHP Warning: PHP Startup: Unable to load dynamic library
'/usr/lib/php/extensions/no-debug-non-zts-20160303/gd2' -
dlopen(/usr/lib/php/extensions/no-debug-non-zts-20160303/gd2, 0x0009):
closured error in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library
'/usr/lib/php/extensions/no-debug-non-zts-20160303/mbstring' -
dlopen(/usr/lib/php/extensions/no-debug-non-zts-20160303/mbstring,
0x0009): closured error in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library
'/usr/lib/php/extensions/no-debug-non-zts-20160303/mysqli' -
dlopen(/usr/lib/php/extensions/no-debug-non-zts-20160303/mysqli,
0x0009): closured error in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library
'/usr/lib/php/extensions/no-debug-non-zts-20160303/pdo_mysql' -
dlopen(/usr/lib/php/extensions/no-debug-non-zts-20160303/pdo_mysql,
0x0009): closured error in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library
'/usr/lib/php/extensions/no-debug-non-zts-20160303/sockets' -
dlopen(/usr/lib/php/extensions/no-debug-non-zts-20160303/sockets,
0x0009): closured error in Unknown on line 0
It seems to be an error with gd2, mbstring, mysqli, pdo_mysql and sockets files but they do not exist on the no-debug-non-zts-20160303/ folder...
Is there a way using homebrew to reinstall all these missing files ?
Thanks

Related

Mac OS Big Sur redis.so: mach-o, but wrong architecture MAMP

I have installed redis on my mac Big Sur 11.0.1 and also, I have installed MAMP. Now, I am trying to add phpredis as redis extension but I am having php error while loading redis.so file which I created using cloned github phpredis used phpize ./configure --with-php-config=/Applications/MAMP/bin/php/php7.4.12/bin/php-config, then restarted the MAMP, it throws the following error
[09-Jan-2021 23:47:55 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'redis.so' (tried: /Applications/MAMP/bin/php/php7.4.12/lib/php/extensions/no-debug-non-zts-20190902/redis.so (dlopen(/Applications/MAMP/bin/php/php7.4.12/lib/php/extensions/no-debug-non-zts-20190902/redis.so, 9): no suitable image found. Did find:
/Applications/MAMP/bin/php/php7.4.12/lib/php/extensions/no-debug-non-zts-20190902/redis.so: mach-o, but wrong architecture
/Applications/MAMP/bin/php/php7.4.12/lib/php/extensions/no-debug-non-zts-20190902/redis.so: mach-o, but wrong architecture), /Applications/MAMP/bin/php/php7.4.12/lib/php/extensions/no-debug-non-zts-20190902/redis.so.so (dlopen(/Applications/MAMP/bin/php/php7.4.12/lib/php/extensions/no-debug-non-zts-20190902/redis.so.so, 9): image not found)) in Unknown on line 0

I can't add pgsql PDO Driver in MAMP on Mac Big Sur

I have installed MAMP and PostgreSQL with PGAdmin4, but I'm having some problems.
I'm getting a psql "command not found error" in my terminal. I have added export PATH=/Library/PostgreSQL/10/bin:$PATH into ~/.bash_profile, but whenever I reopen the terminal, I get the same error again.
Whenever I try to execute composer or php artisan in my Laravel project I get the below errors, but I'm still able to migrate database:
Warning: PHP Startup: Unable to load dynamic library 'pdo_pgsql' (tried: /usr/local/lib/php/pecl/20180731/pdo_pgsql (dlopen(/usr/local/lib/php/pecl/20180731/pdo_pgsql, 9): image not found)
Warning: PHP Startup: Unable to load dynamic library 'pgsql' (tried: /usr/local/lib/php/pecl/20180731/pgsql (dlopen(/usr/local/lib/php/pecl/20180731/pgsql, 9): image not found)
Getting a "driver not found" error whenever trying to browse the project and in PDO Drivers list in phpinfo(), mysql and sqlite available, but pgsql is not available.
MAMP
PostgreSQL 10
PHP: 7.3.21
OS: MAC Big Sur
I had the same issue and when I looked in my php.ini file, I saw that my extensions folder was pointed to the wrong location:
extension_dir = "/Applications/MAMP/bin/php/php7.4.2/lib/php/extensions"
But I don't have a matching directory for php7.4.2 - I use php7.4.9, and confirmed the extension exists in that folder. To fix it for me, I just had to change the above line in my php.ini file to:
extension_dir = "/Applications/MAMP/bin/php/php7.4.9/lib/php/extensions"
And then all was good for me.

PHP Startup: Unable to load dynamic library mongodb.so Symbol not found

I installed mongodb php driver on MACOS, XAMPP and PHP 7.1.11 by command line sudo pecl install mongodb then run php -v and got errors
$ php -v
PHP Warning: PHP Startup: Unable to load dynamic library '/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20160303/mongodb.so' - dlopen(/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20160303/mongodb.so, 9): Symbol not found: _zend_ce_countable
Referenced from: /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20160303/mongodb.so
Expected in: flat namespace
in /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20160303/mongodb.so in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20160303/mongodb.so' - dlopen(/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20160303/mongodb.so, 9): Symbol not found: _zend_ce_countable
Referenced from: /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20160303/mongodb.so
Expected in: flat namespace
in /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20160303/mongodb.so in Unknown on line 0
Configuration File (php.ini) Path: /Applications/XAMPP/xamppfiles/etc
Loaded Configuration File: /Applications/XAMPP/xamppfiles/etc/php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed: (none)
Please help !

Compser is updating with some warnings

This happens in my mac osx. This is regarding zend framework 3.
When I update the composer some warnings are occur.
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/Cellar/php70/7.0.15_8/lib/php/extensions/no-debug-non-zts-20151012/mcrypt.so' - dlopen(/usr/local/Cellar/php70/7.0.15_8/lib/php/extensions/no-debug-non-zts-20151012/mcrypt.so, 9): image not found in Unknown on line 0
after that when the page is refreshing this error occur.
Fatal error: Uncaught Error: Class 'MongoDB\Driver\Manager' not found in /Users/ishara/Documents/workspace/leapx-portal/vendor/mongodb/mongodb/src/Client.php on line 81
Error: Class 'MongoDB\Driver\Manager' not found in /Users/ishara/Documents/workspace/leapx-portal/vendor/mongodb/mongodb/src/Client.php on line 81
This has nothing to do with zendframework 3.
PHP Warning: PHP Startup: Unable to load dynamic library mcrypt.so
This is probably caused by not having the PHP mcrypt extension installed.
Fatal error: Uncaught Error: Class 'MongoDB\Driver\Manager' not found
According to the mongodb/mongodb package, you need to install the PHP mongodb extension.

problems installing pdo_psql on snow leapord

I'm trying to install the pdo drivers on OSX 10.6 and I've been following the directions found here:
Installing PDO-drivers for PostgreSQL on Mac (using Zend for eclipse)
Every time I try and compile the pdo_psql.so driver it compiles fine but the 'make test' finds a problem.
PHP Warning: PHP Startup: Unable to load dynamic library '/Users/me/temp/PDO_PGSQL-1.0.2/modules/pdo_pgsql.so' - dlopen(/Users/me/temp/PDO_PGSQL-1.0.2/modules/pdo_pgsql.so, 9): no suitable image found. Did find:
/Users/me/temp/PDO_PGSQL-1.0.2/modules/pdo_pgsql.so: mach-o, but wrong architecture in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/Users/me/temp/PDO_PGSQL-1.0.2/modules/pdo_pgsql.so' - dlopen(/Users/me/temp/PDO_PGSQL-1.0.2/modules/pdo_pgsql.so, 9): no suitable image found. Did find:
/Users/me/temp/PDO_PGSQL-1.0.2/modules/pdo_pgsql.so: mach-o, but wrong architecture in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/Users/me/temp/PDO_PGSQL-1.0.2/modules/pdo_pgsql.so' - dlopen(/Users/me/temp/PDO_PGSQL-1.0.2/modules/pdo_pgsql.so, 9): no suitable image found. Did find:
/Users/me/temp/PDO_PGSQL-1.0.2/modules/pdo_pgsql.so: mach-o, but wrong architecture in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/Users/me/temp/PDO_PGSQL-1.0.2/modules/pdo_pgsql.so' - dlopen(/Users/me/temp/PDO_PGSQL-1.0.2/modules/pdo_pgsql.so, 9): no suitable image found. Did find:
/Users/me/temp/PDO_PGSQL-1.0.2/modules/pdo_pgsql.so: mach-o, but wrong architecture in Unknown on line 0
=====================================================================
PHP : /usr/bin/php
PHP_SAPI : cli
PHP_VERSION : 5.3.4
ZEND_VERSION: 2.3.0
PHP_OS : Darwin - Darwin localhost 10.7.0 Darwin Kernel Version 10.7.0: Sat Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386 i386
INI actual : /Users/me/temp/PDO_PGSQL-1.0.2/tmp-php.ini
More .INIs :
CWD : /Users/me/temp/PDO_PGSQL-1.0.2
Extra dirs :
VALGRIND : Not used
=====================================================================
TIME START 2011-04-12 00:35:43
=====================================================================
I'm running a 32 bit kernel and my env vars are set as such. After google-ing for hours I'm stuck. Thanks for any help you can provide.
It turns out with my new laptop I grabbed the wrong disk set for Xcode. When I installed the correct (newest) version, everything worked.