Ошибка php startup unable to load dynamic library

I run a PHP script and get this error:

PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/local/lib/php/extensions/no-debug-non-zts-20090626/ixed.5.2.lin’ — /usr/local/lib/php/extensions/no-debug-non-zts-20090626/ixed.5.2.lin: cannot open shared object file: No such file or directory in Unknown on line 0

What does that mean?

random's user avatar

random

9,75710 gold badges66 silver badges83 bronze badges

asked Mar 12, 2011 at 11:41

Popolo's user avatar

0

It means there is an extension=... or zend_extension=... line in one of your php configuration files (php.ini, or another close to it) that is trying to load that extension : ixed.5.2.lin

Unfortunately that file or path doesn’t exist or the permissions are incorrect.

  1. Try to search in the .ini files that are loaded by PHP (phpinfo() can indicate which ones are) — one of them should try to load that extension.
  2. Either correct the path to the file or comment out the corresponding line.

Simon East's user avatar

Simon East

55.2k17 gold badges139 silver badges133 bronze badges

answered Mar 12, 2011 at 11:45

Pascal MARTIN's user avatar

Pascal MARTINPascal MARTIN

394k80 gold badges653 silver badges660 bronze badges

7

If you’re on Linux, you can find all loaded configuration files by typing this in shell:

php -r "print phpinfo();" | grep ".ini"

UPDATE:
As mentioned in comments, this can be even more accurate:

php -i | grep ini

answered Mar 6, 2014 at 22:07

nefski's user avatar

nefskinefski

6916 silver badges12 bronze badges

2

phpStom with XAMPP

TL;DR Except from verifying that the files exist, you might need to add the drive letter to some records in your php.ini file

I suddenly started having a problem using phpStorm 7 for debugging php with xampp and xdebug. When trying to set intellij interperter to be xampps php I got a lot of the warnings like the one in the question, for example:

Unable to load dynamic library ‘/xampp/php/ext/php_bz2.dll’

For some reason I had to add my drive letter to the records of extension_dir and browscap in the php.ini file:

extension_dir = "xamppphpext"
browscap = "xamppphpextrasbrowscap.ini"

to

extension_dir = "e:xamppphpext"
browscap = "e:xamppphpextrasbrowscap.ini"

answered Sep 25, 2015 at 18:47

Technotronic's user avatar

TechnotronicTechnotronic

8,3343 gold badges40 silver badges53 bronze badges

3

If you just want to make the error disappear, and you don’t need the extension, then by all means comment the line out in php.ini. But if you actually want to fix the problem here is some additional info.

There are various causes for this based on the exact module, but there are also some general guidelines.

  1. Open phpinfo() and look for extension_dir under the Core section. This is where your modules should be located.

For instance, /usr/lib/php/modules for Unix/Linux.

  1. If the file does in fact exist, make sure permissions are adequate.
  2. If the file does not exist, use the resources below to install it.

Installation on *nix (PEAR)
Installation of extensions on Windows

Ken Y-N's user avatar

Ken Y-N

14.6k21 gold badges70 silver badges112 bronze badges

answered May 21, 2015 at 10:55

EternalHour's user avatar

EternalHourEternalHour

8,2486 gold badges37 silver badges57 bronze badges

4

Loading .dll in Linux

I’ve encountered this warning message while I was trying to install a php-extension via the php.ini file;

until I figured out that you cannot load .dll extensions in Linux,

but you have to comment the extensions that you want to import ;extension= ... .dll and install it correctly via sudo apt-get install php-...

note: ... is the extension name you want to enable.

answered Oct 16, 2018 at 7:08

Marco D.G.'s user avatar

Marco D.G.Marco D.G.

2,27716 silver badges31 bronze badges

1

php -r "echo php_ini_loaded_file();"

Will show in CLI current ini loaded file, search there for Your extension, path to it is incorrect.

answered Jul 18, 2017 at 11:09

Błażej Krzakala's user avatar

In my case, this message started to appear when I updated the php version to 7.4.

To solve it I had to look for the php.ini files found inside the php version folder (/etc/php/7.4/apache2/ && /etc/php/7.4/cli/) checking the lines where the extensions I could see that the extensions gd2 and intl were uncommented.

answered Sep 21, 2020 at 14:07

David G Marquez's user avatar

Note that you can also get this error if your PHP library doesn’t have the «other» directory opening permission. In my particular case, I noticed this when using php -l to syntax check a script in my text editor. This meant that since my account was called «volomike», that account didn’t have permission to run the libraries that the php command relied upon.

For instance, on Ubuntu 14.04, I had PHP5 installed automatically into the path /usr/lib/php5/20121212+lfs. However, because I was working in C++ in building some shared objects, I messed around with the directory permissions and screwed things up such that non-root accounts did not have the directory execute (directory open) permissions to view /usr/lib/php5/20121212+lfs. So, I typed the following command to rectify that problem:

sudo chmod o+x /usr/lib/php5/20121212+lfs.

Now when I do php -l example.php as a non-root user, it never gives me this «Unabled to load dynamic library» problem anymore.

answered Apr 26, 2016 at 4:56

Volomike's user avatar

VolomikeVolomike

23.6k20 gold badges112 silver badges207 bronze badges

2

I had the same problem on XAMPP for Windows when I try to install composer.
I did php -v and php throwing error :

Unable to load dynamic library ‘/xampp/php/ext/php_bz2.dll’

It took me a while until I realized that I need to setup my XAMPP. So I run setup_xampp.bat and php return to works like a charm.

answered Feb 23, 2016 at 1:11

Prima Putra's user avatar

I had this error on a number of modules when I had been running different versions of PHP side by side on my server. To sort this out, I needed to install the packages it couldn’t find for that specific PHP version. So, for example, if I saw:-

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20160303/xml.so'

I would install the library for the PHP version specifically:-

sudo apt-get install php7.1-xml

And then restart Apache. Fixed it for me. You can check your version like this:-

php -v

answered Oct 17, 2018 at 8:12

Rod's user avatar

RodRod

811 silver badge2 bronze badges

I had the same problem on XAMPP for Windows10 when I try to install composer.

Unable to load dynamic library ‘/xampp/php/ext/php_bz2.dll’

Then follow this steps

  1. just open your current_xampp_containing_drive:xampp(default_xampp_folder)phpphp.ini in texteditor (like notepad++)
  2. now just find — is the current_xampp_containing_drive:xampp exist?
  3. if not then find the «extension_dir» and get the drive name(c,d or your desired drive) like.

extension_dir=»F:xampp731phpext» (here finded_drive_name_from_the_file is F)

  1. again replace with finded_drive_name_from_the_file:xampp with current_xampp_containing_drive:xampp and save.
  2. now again start the composer installation progress, i think your problem will be solved.

answered Jan 31, 2020 at 10:21

Anjani Barnwal's user avatar

Anjani BarnwalAnjani Barnwal

1,3421 gold badge16 silver badges23 bronze badges

What I did was;

1 — I first find out what version of PHP I am using thru the function phpinfo()

<?php   
    phpinfo();
?>

2 — From there you will find the location of your configuration(php.ini) file

method phpinfo() result

3 — Open that file

4 — Comment out the line similar to the image below

This might be a different value but it should be related to extension.
I am no expert but this process helped me solved similar problem.

enter image description here

answered Mar 24, 2020 at 4:37

newProgramm3r's user avatar

In my case I got this error because I downloaded a thread-safe version of the dll (infixed with -ts-), but my installation of php was a non-thread-safe (infixed with -nts-). Downloading the right version of the dll, exactly matching my php installation version fixed the issue.

answered May 10, 2020 at 15:18

Klesun's user avatar

KlesunKlesun

12.1k5 gold badges57 silver badges51 bronze badges

1

After Windows 10 XAMPP now I installed LAMPP (XAMPP) on Ubuntu. Windows XAMPP had a lot less to configure compare to MAC (iOS) but now with Linux Ubuntu I had a few more since there are more going in Linux (a good thing).

I confused and activated mysqli.dll (and mysql.dll: erase «#» in /etc/php/7.2/cli/php.ini

I started to get the PHP Warning: PHP Startup: Unable to load dynamic library message related to dll. I commented out mysql(and i).dll in the same file but the message didn’t go away up until I commented out » » in /opt/lampp/etc/php.ini.

Looks like XAMPP reads php.ini file from /etc/php/7.2/cli and makes modification in php.ini of /opt/lampp/etc. (;extension=php_pdo_mysql.dll after «;» restarted Apache and no more any message.

kuzdu's user avatar

kuzdu

7,0551 gold badge51 silver badges68 bronze badges

answered Dec 3, 2018 at 12:04

Mehmet F Erten's user avatar

I encountered a similar error. The mistake I made was to use the «controller» name as «Pages» instead of «pages» in my url.

answered Jan 30, 2017 at 8:58

Ninad Kulkarni's user avatar

0

In Windows, it could be a wrong path in «System environment variables».
«Path» to the php.exe directory must be the good one.

answered Sep 18, 2019 at 13:58

François Breton's user avatar

‘C:/PHP/5.2.13/extphp_mcrypt1.dll’

I’d say there’s some typo on your php.ini (the extra 1). Perhaps you’re loading a different php.ini from what you expect (see the output of php.ini to make sure).

Other than that make sure that php_mcrypt.dll and PHP:

Were linked to the same VC runtime library (typically msvcrt.dll for VC6 or msvcrt90.dll for VC9) – use e.g. the dependency walker for this
Are both debug builds or both release builds
Both have ZTS enabled or ZTS disabled
For libraries that depend on further libraries (DLLs), make sure they are available (e.g. in the same directory as the extension)
PHP should give you meaning errors if any of the first three conditions above is not satisfied, but I wrote those anyway because I’m not sure for PHP 5.2.

answered Mar 31, 2020 at 6:29

Dharmendra Soni's user avatar

Dharmendra SoniDharmendra Soni

1451 gold badge4 silver badges8 bronze badges

From C:xamppphpphp.exe I got

  • Unable to load dynamic library »
  • C:xamppphpextphp_.dll (The specified module could not be found.)

I solved by commenting out
C:xamppphpphp.ini
;extension=

answered Oct 16, 2020 at 7:08

Lubomir Zatko's user avatar

I had the same problem when I tried to use php with sql server, when I added the sqlsrv libraries … it gave me the error, after several days of researching there, I understood that microsoft does not support x64 in this case so what I did was install laragon x86 and use the corresponding libraries. I hope it helps with something

answered Dec 28, 2021 at 18:37

Esbelio's user avatar

Go to system env variable and set the php ext dir path as

C:xamppphpext

basically it’s finding the ext directory and then locating it’s file but it’s unable to find the files becuase php path is set as different.

answered Mar 15, 2022 at 7:55

Hadayat Niazi's user avatar

Hadayat NiaziHadayat Niazi

1,9112 gold badges15 silver badges28 bronze badges

This also occurs if you are running the command from a different drive other that the one that PHP is installed in
Ideally if your php folder is in c: the your project folder should also be in c:

answered May 13 at 18:21

user3248382's user avatar

Если при запуске PHP приложения в ОС Windows выдается сообщение типа «PHP Warning:  PHP Startup: Unable to load dynamic library ‘pdo_sqlite’ (tried: C:phpextpdo_sqlite (The specified module could not be found.), C:phpextphp_pdo_sqlite.dll (The specified module could not be found.)) in Unknown on line 0» это означает, что PHP Не смог найти библиотеку sqlite.

Путь к библиотекам и то, какие библиотеки должны быть подключены, прописано в файле php.ini. Я рекомендую его размещать в той же директории, где размещены файлы PHP.

Чтобы искать расширения в нужной папке, а не в той, которую PHP считает папкой по умолчанию, нужно раскомментировать строку с параметром extension_dir и установить ей путь к расширениям:

extension_dir = «C:usrbinphp7ext»

Также нужно проверить, включено ли расширение sqlite для PHP или нет. В файле php.ini это блок extension, нужно в нем раскомментировать pdo_sqlite:

extension=pdo_sqlite

Также надо убедиться, что файлы в папке «C:usrbinphp7ext» (или той, которую указали в extension_dir) есть библиотеки расширений для PHP.


No comments yet.

Для проекта необходима версия «php»: «^7.1.3», у меня была установлена в модулях 7.0.14 в версии 5.2.2.0 Пришлось скачать OS версию 5.2.8 В модулях выбран php 7.2*64 Apache 7.2*62
В phpinfo также инфа о том, что версия 7.2

В параметрах был изменен путь и версия php: Компьютер -> Свойство системы -> Дополнительный параметры -> «Дополнительно : Переменная среда» В системных переменных «Path» D:OpenServermodulesphpPHP-7.2*64

Но в cmd при запуске команды «composer update» теперь ругается на отсутствие кучи библиотек

spoiler

PHP Warning: PHP Startup: Unable to load dynamic library ‘php_mbstring.dll’ (tried: w:/modules/php/PHP-7.2-x64/ext/php_mbstring.dll (▒▒ ▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒. ), w:/modules/php/PHP-7.2-x64/ext/php_php_mbstring.dll.dll (▒▒ ▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒. )) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library ‘php_bz2.dll’ (tried: w:/modules/php/PHP-7.2-x64/ext/php_bz2.dll (▒▒ ▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒. ), w:/modules/php/PHP-7.2-x64/ext/php_php_bz2.dll.dll (▒▒ ▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒. )) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library ‘php_curl.dll’ (tried: w:/modules/php/PHP-7.2-x64/ext/php_curl.dll (▒▒ ▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒. ), w:/modules/php/PHP-7.2-x64/ext/php_php_curl.dll.dll (▒▒ ▒▒▒▒▒▒ ▒▒

и т.д

А также

spoiler

[ComposerExceptionNoSslException] The openssl extension is required for SSL/TLS protection but is not available. If you can not enable the openssl ex tension, you can disable this error, at your own risk, by setting the ‘disable-tls’ option to true.

В config php 7.2 *64 эти extension имеются и не закомм.


  • Вопрос задан

    более трёх лет назад

  • 13395 просмотров

1 Создать папку ext в модулях, к примеру:
D:Open ServerOSPanelmodulesphpext

2 В папку ext перенести все dll из текущей версии php

3 В config (D:OSoldOpenServeruserdataconfig) изменить относительные пути т.к. Apache не понимает относительные пути php.ini в системах Windows.
extension_dir="C:fullpathtophpext"

Пригласить эксперта

Проблема была в том, что в файле php.ini были кривые пути.
Начиналось все с диска W, причем у меня его вообще нет. я поменял все w: и w:/ (нужно посмотреть, какой диск у Вас) на правильный путь. все заработало 100% (перезапустить консоль нужно).
Понимаю, что автору мой комментарий не нужен уже, но вдруг кто-то это увидит и кому-то это поможет.

Если кто-то вдруг столкнулся с похожей проблемой, но у него уже есть папка ext и все модули в ней, то мне помог вариант с редактированием php.ini. Добавьте верху подключений extension директиву extension_dir = "ext"

Возможно, у вас не будет самого php.ini, тогда скопируйте его из соседнего файла dev или prod версии.
Моя задача была — включить директиву openssl в настройках openserver php7.4 и установить composer.


  • Показать ещё
    Загружается…

13 июн. 2023, в 17:10

3000 руб./за проект

13 июн. 2023, в 17:07

10000 руб./за проект

13 июн. 2023, в 17:05

2500 руб./за проект

Минуточку внимания

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.

  • PHP 8.1
  • PHP MySQL (php8.1-mysql)

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.

Screenshot

Screenshot 2022-05-08 at 6 51 33 PM

PHP Version

PHP 8.1.2

Operating System

Ubuntu 20.04

I got error like

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_intl.dll' - /usr/lib/php/20151012/php_intl.dll: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_soap.dll' - /usr/lib/php/20151012/php_soap.dll: cannot open shared object file: No such file or directory in Unknown on line 0

As @Parto said

I run php -i | grep ".ini"

And got result :-

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_intl.dll' - /usr/lib/php/20151012/php_intl.dll: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_soap.dll' - /usr/lib/php/20151012/php_soap.dll: cannot open shared object file: No such file or directory in Unknown on line 0
Configuration File (php.ini) Path => /etc/php/7.0/cli
Loaded Configuration File => /etc/php/7.0/cli/php.ini
Scan this dir for additional .ini files => /etc/php/7.0/cli/conf.d
Additional .ini files parsed => /etc/php/7.0/cli/conf.d/10-mysqlnd.ini,
/etc/php/7.0/cli/conf.d/10-opcache.ini,
/etc/php/7.0/cli/conf.d/10-pdo.ini,
/etc/php/7.0/cli/conf.d/15-xml.ini,
/etc/php/7.0/cli/conf.d/20-bcmath.ini,
/etc/php/7.0/cli/conf.d/20-calendar.ini,
/etc/php/7.0/cli/conf.d/20-ctype.ini,
/etc/php/7.0/cli/conf.d/20-curl.ini,
/etc/php/7.0/cli/conf.d/20-dom.ini,
/etc/php/7.0/cli/conf.d/20-exif.ini,
/etc/php/7.0/cli/conf.d/20-fileinfo.ini,
/etc/php/7.0/cli/conf.d/20-ftp.ini,
/etc/php/7.0/cli/conf.d/20-gd.ini,
/etc/php/7.0/cli/conf.d/20-gettext.ini,
/etc/php/7.0/cli/conf.d/20-iconv.ini,
/etc/php/7.0/cli/conf.d/20-intl.ini,
/etc/php/7.0/cli/conf.d/20-json.ini,
/etc/php/7.0/cli/conf.d/20-mbstring.ini,
/etc/php/7.0/cli/conf.d/20-mcrypt.ini,
/etc/php/7.0/cli/conf.d/20-mysqli.ini,
/etc/php/7.0/cli/conf.d/20-pdo_mysql.ini,
/etc/php/7.0/cli/conf.d/20-phar.ini,
/etc/php/7.0/cli/conf.d/20-posix.ini,
/etc/php/7.0/cli/conf.d/20-readline.ini,
/etc/php/7.0/cli/conf.d/20-shmop.ini,
/etc/php/7.0/cli/conf.d/20-simplexml.ini,
/etc/php/7.0/cli/conf.d/20-soap.ini,
/etc/php/7.0/cli/conf.d/20-sockets.ini,
/etc/php/7.0/cli/conf.d/20-sysvmsg.ini,
/etc/php/7.0/cli/conf.d/20-sysvsem.ini,
/etc/php/7.0/cli/conf.d/20-sysvshm.ini,
/etc/php/7.0/cli/conf.d/20-tokenizer.ini,
/etc/php/7.0/cli/conf.d/20-wddx.ini,
/etc/php/7.0/cli/conf.d/20-xmlreader.ini,
/etc/php/7.0/cli/conf.d/20-xmlwriter.ini,
/etc/php/7.0/cli/conf.d/20-xsl.ini,
/etc/php/7.0/cli/conf.d/20-zip.ini
user_ini.cache_ttl => 300 => 300
user_ini.filename => .user.ini => .user.ini
com_init_db => 0
Classes => AppendIterator, ArrayIterator, ArrayObject, BadFunctionCallException, BadMethodCallException, CachingIterator, CallbackFilterIterator, DirectoryIterator, DomainException, EmptyIterator, FilesystemIterator, FilterIterator, GlobIterator, InfiniteIterator, InvalidArgumentException, IteratorIterator, LengthException, LimitIterator, LogicException, MultipleIterator, NoRewindIterator, OutOfBoundsException, OutOfRangeException, OverflowException, ParentIterator, RangeException, RecursiveArrayIterator, RecursiveCachingIterator, RecursiveCallbackFilterIterator, RecursiveDirectoryIterator, RecursiveFilterIterator, RecursiveIteratorIterator, RecursiveRegexIterator, RecursiveTreeIterator, RegexIterator, RuntimeException, SplDoublyLinkedList, SplFileInfo, SplFileObject, SplFixedArray, SplHeap, SplMinHeap, SplMaxHeap, SplObjectStorage, SplPriorityQueue, SplQueue, SplStack, SplTempFileObject, UnderflowException, UnexpectedValueException

I am using php 7 and Ubuntu 16.04

Понравилась статья? Поделить с друзьями:
  • Ошибка pen list corrupt что это
  • Ошибка php notice array to string conversion in
  • Ошибка peer failed to perform tls handshake failed
  • Ошибка php mbstring но он есть
  • Ошибка peer authentication failed for user postgres