-
Notifications
You must be signed in to change notification settings - Fork 7.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to load dynamic library 'mysqli' #14051
Comments
If you re using the homebrew php formula, mysqli is not a shared dynamic module but a builtin one. Did you modify module loading configuration in php.ini or anything ? |
@devnexen Thanks for your reactivity. I just install php with homebrew and uncomment the 'extension=mysqli' to use it. But i always get a error when i try to execute the code. |
why do you need to uncomment this line to use mysqli ? |
When using Homebrew, mysqli is built into php package itself: https://github.com/Homebrew/homebrew-core/blob/093893a86a134347ee515d53f977ea2f0a1cc808/Formula/p/php.rb#L167 Similar issue: shivammathur/homebrew-php#73 Probably commenting back that extension=mysqli extension will be enough. |
For me it's not enought because i get a error message that say that mysqli extension is missing. |
Is your mysqli code within a try/catch block ? |
@logan-oss: If you are getting a Although the error message might not be obvious, it can mean that your code is trying to connect to the database server via a UNIX socket (as opposed to via an IP address) and that socket file isn't found (i.e. there isn't a local database server running). I would suggest double checking the database server you are trying to connect to (can you connect to it via a GUI for instance); and once you have confirmed it is running correctly, double check your code to ensure your code is connecting to it correctly. |
This doesn't mean the extension can't be found, it means that it can't connect to the mysqli socket, i.e. the "no such file or directory" is about the socket. |
Hello,
I have a issue with php in MacOS. I use a MacBook Air M1 2020 and i have a issue with php extensions. I can't use mysqli extension because the file mysqli.so doesn't exist.
The complete message is :
PHP Warning: PHP Startup: Unable to load dynamic library 'mysqli' (tried: /opt/homebrew/lib/php/pecl/20230831/mysqli (dlopen(/opt/homebrew/lib/php/pecl/20230831/mysqli, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20230831/mysqli' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/lib/php/pecl/20230831/mysqli' (no such file), '/opt/homebrew/lib/php/pecl/20230831/mysqli' (no such file)), /opt/homebrew/lib/php/pecl/20230831/mysqli.so (dlopen(/opt/homebrew/lib/php/pecl/20230831/mysqli.so, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20230831/mysqli.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/lib/php/pecl/20230831/mysqli.so' (no such file), '/opt/homebrew/lib/php/pecl/20230831/mysqli.so' (no such file))) in Unknown on line 0
The text was updated successfully, but these errors were encountered: