- mysqli — PHP Startup Не удается загрузить динамическую библиотеку /usr/lib/php/20151012/php_mysqli.dll
- Другие решения
- Saved searches
- Use saved searches to filter your results more quickly
- PHP Warning: PHP Startup: Unable to load dynamic library ‘mysqli’ #8516
- PHP Warning: PHP Startup: Unable to load dynamic library ‘mysqli’ #8516
- Comments
- Description
- PHP startup unable to load dynamic library warning
- Take your skills to the next level ⚡️
- About
- Search
- Tags
- Linux Mint Forums
- PHP extension mysqli missing
mysqli — PHP Startup Не удается загрузить динамическую библиотеку /usr/lib/php/20151012/php_mysqli.dll
Если вы работаете в Linux, у вас должны быть не DLL-файлы, а SO-файлы.
Итак, сначала вы должны удалить / отключить php_mysqli.dll, который вы добавили в php.ini.
Чтобы использовать mysqli, вы должны:
- установить пакет для Ubuntu: apt-get install php-mysql
- проверьте, включен ли он уже (с помощью phpinfo() например)
- если не включен, включите модуль — проверьте /etc/php/mods-available/ папка, если есть mysqli.ini , содержащий extension=mysqli.so затем проверьте CLI / FPM / Apache / other на наличие символической ссылки, указывающей на этот файл (например, для CLI в /etc/php/cli/conf.d/ : 20-mysqli.ini -> ../../mods-available/mysqli.ini )
- перезапустите php / apache / nginx в зависимости от того, что вы используете
Другие решения
Я недавно столкнулся с этой проблемой на Ubuntu16.04, я, наконец, решить ее, добавив точку с запятой в каждой строке, как extension=php_*.dll Я думаю, это потому, что LAMP на Ubuntu достаточно умный — он автоматически открывает все расширения для нас. А на окнах мы должны включить расширения вручную, удалив точку с запятой в каждой строке, как ;extension=php_*.dll в php.ini ,
В моем случае это произошло потому, что я раскомментировал extension=php_mysqli.dll строка в файле php.ini для запуска какого-либо другого пакета. После поисков я обнаружил, что вам не следует ничего раскомментировать прямо из php.ini, вместо этого вы должны установить требуемое расширение php, и оно сделает все остальное.
Просто закомментируйте все строки с расширениями .dll, потому что вы находитесь в Ubuntu. Ubuntu поддерживает .so файлы.
В php.ini под Dynamic Extensions линия extension=php_mysqli.dll был включен.
Я отключил его, добавив точку с запятой в начале строки ;extension=php_mysqli.dll ,
Сохранено и завершено php.ini , Restarted Apache ,
Это решило ошибку для меня.
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
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
PHP Warning: PHP Startup: Unable to load dynamic library ‘mysqli’ #8516
PHP Warning: PHP Startup: Unable to load dynamic library ‘mysqli’ #8516
Comments
Description
I have enabled mysqli extension for php 8.1 on ubuntu 20.04.
After enabling extension I’m getting the following error:
PHP Warning: PHP Startup: Unable to load dynamic library 'mysqli' (tried: /usr/lib/php/20210902/mysqli (/usr/lib/php/20210902/mysqli: cannot open shared object file: No such file or directory), /usr/lib/php/20210902/mysqli.so (/usr/lib/php/20210902/mysqli.so: undefined symbol: mysqlnd_global_stats)) in Unknown on line 0
I have installed the current packages.
When I do php —ini . I get the following output.
PHP Warning: PHP Startup: Unable to load dynamic library 'mysqli' (tried: /usr/lib/php/20210902/mysqli (/usr/lib/php/20210902/mysqli: cannot open shared object file: No such file or directory), /usr/lib/php/20210902/mysqli.so (/usr/lib/php/20210902/mysqli.so: undefined symbol: mysqlnd_global_stats)) in Unknown on line 0 Configuration File (php.ini) Path: /etc/php/8.1/cli Loaded Configuration File: /etc/php/8.1/cli/php.ini Scan for additional .ini files in: /etc/php/8.1/cli/conf.d Additional .ini files parsed: /etc/php/8.1/cli/conf.d/10-mysqlnd.ini, /etc/php/8.1/cli/conf.d/10-opcache.ini, /etc/php/8.1/cli/conf.d/10-pdo.ini, /etc/php/8.1/cli/conf.d/20-calendar.ini, /etc/php/8.1/cli/conf.d/20-ctype.ini, /etc/php/8.1/cli/conf.d/20-exif.ini, /etc/php/8.1/cli/conf.d/20-ffi.ini, /etc/php/8.1/cli/conf.d/20-fileinfo.ini, /etc/php/8.1/cli/conf.d/20-ftp.ini, /etc/php/8.1/cli/conf.d/20-gettext.ini, /etc/php/8.1/cli/conf.d/20-iconv.ini, /etc/php/8.1/cli/conf.d/20-mysqli.ini, /etc/php/8.1/cli/conf.d/20-pdo_mysql.ini, /etc/php/8.1/cli/conf.d/20-phar.ini, /etc/php/8.1/cli/conf.d/20-posix.ini, /etc/php/8.1/cli/conf.d/20-readline.ini, /etc/php/8.1/cli/conf.d/20-shmop.ini, /etc/php/8.1/cli/conf.d/20-sockets.ini, /etc/php/8.1/cli/conf.d/20-sysvmsg.ini, /etc/php/8.1/cli/conf.d/20-sysvsem.ini, /etc/php/8.1/cli/conf.d/20-sysvshm.ini, /etc/php/8.1/cli/conf.d/20-tokenizer.ini
I’m note sure mysqlnd extension. I have not added it or enabled it in any of the php.ini file.
NOTE: I’m facing exact similar issue in the macos as well. Not sure which package or configuration I’m missing and because of that I’m getting this error.
PHP startup unable to load dynamic library warning
Most often, this happens when PHP can’t find the extension you defined in your php.ini file.
For example, the error goes like this:
To solve this warning, you need to make sure that PHP is able to find the required extension.
First, find the php.ini file location by running the phpinfo() function as follows:
Once you find the php.ini location, open the file and search for the line that says extension_dir as shown below:
The extension_dir configuration is used to define a folder where your PHP extensions are stored.
Open the extension_dir using your file explorer and see if the extension that causes the warning exists in that folder.
For example, the mysqli extension requires the php_mysqli.dll file (Windows) or php_mysqli.so (UNIX-like)
When you don’t find the file, then you need to somehow get it from the Internet.
For Windows, you can download the compiled PHP version from windows.php.net and get the extension in ext/ folder in the zip file.
You need to copy the extension from the ext/ folder to your extension_dir folder.
For UNIX-like OS, you can install PHP extensions with PEAR.
Once you have the extension, restart your PHP server. The warning should now disappear.
If you know that you don’t need the extension, you can comment out the extension to make the warning go away.
Add a semicolon ( ; ) before the extension configuration as shown below:
Save the changes to the php.ini file and restart your PHP server. You should no longer see the warning.
Now you’ve learned how to solve the warning PHP Startup: Unable to load dynamic library. Great work! 👍
Take your skills to the next level ⚡️
I’m sending out an occasional email with the latest tutorials on programming, web development, and statistics. Drop your email in the box below and I’ll send new stuff straight into your inbox!
About
Hello! This website is dedicated to help you learn tech and data science skills with its step-by-step, beginner-friendly tutorials.
Learn statistics, JavaScript and other programming languages using clear examples written for people.
Search
Type the keyword below and hit enter
Tags
Click to see all tutorials tagged with:
Linux Mint Forums
Forum rules
Before you post please read how to get help. Topics in this forum are automatically closed 6 months after creation.
PHP extension mysqli missing
Post by Rotavator » Sun Apr 05, 2020 3:03 am
I am pretty much new to the linux world and the LAMP stack.
I’m running LM 19.3 Cinnamon. I have installed PHP 7.2.24. I have installed MariaDB Ver 15.1 Distrib 10.3.22-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
Note, I am NOT running Apache — I do not at this time want to operate a web server, I just want a local database. I want to use PHP to make a couple API calls now and then to get some data from a web site, but I don’t want to run a website myself.
I am trying to install phpmyadmin, version 5.0.2, via Composer, and running into problems. (There’s a version of phpmyadmin in the stock LM package «store», but it is quite a few versions old, so I wanted the newest.)
It may not be the only problem, but the first complaint is that I don’t have the PHP mysqli extension installed or enabled.
So I edited the php.ini file to uncomment «extension=mysqli». I also tried phpenmod mysqli.
Now when I launch PHP I get this:
PHP Warning: PHP Startup: Unable to load dynamic library ‘mysqli’ (tried: /usr/lib/php/20170718/mysqli (/usr/lib/php/20170718/mysqli: cannot open shared object file: No such file or directory), /usr/lib/php/20170718/mysqli.so (/usr/lib/php/20170718/mysqli.so: undefined symbol: mysqlnd_global_stats)) in Unknown on line 0
The mysqli.so file seems to be missing entirely from my machine. I have searched for it and not found it. I tried variations on the name. mysqli is listed in the mods_available directory, but even that ini file refers to the mysqli.so file, which just isn’t anywhere to be found.
I have looked at a lot of articles on the web and tried a few things recommended, but most of those relate to the simple issues — setting up php.ini correctly, enabling the extension, etc. Everyone assumes that the mysqli.so file does actually exist somewhere on the machine.
I have not yet tried uninstalling PHP 7.2 and reinstalling — partly because I would rather not lose another extension that was somewhat troublesome to install. If that’s my only option, I’ll have to try it, but does anyone here know if there is some other way to get hold of and install just the mysqli extension?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.