Как исправить ошибку «PHP Startup: Unable to load dynamic library»?
Для проекта необходима версия «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:\OpenServer\modules\php\PHP-7.2*64
Но в cmd при запуске команды «composer update» теперь ругается на отсутствие кучи библиотек
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 (▒▒ ▒▒▒▒▒▒ ▒▒
[Composer\Exception\NoSslException] 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 имеются и не закомм.
PHP Startup: Unable to load dynamic library, Windows, Apache 2.2, php 5.2.11
This is becoming a very frustrating issue. I am trying to do a clean install of apache 2.2 and PHP 5.2.11. Everything seems to be configured correctly but the php modules aren’t starting.
All the files are there. The .dll files such as ssleay32.dll, libmcrypt.dll, libmysql.dll, libeay32.dll are all installed at.
C:/Program Files (x86)/Apache Software Foundation/Apache2.2/php/
I also included them in the C:\Windows\System32
and even added C:/Program Files (x86)/Apache Software Foundation/Apache2.2/php/ to the windows path.
I have no idea why this isn’t working and it feels like a no win situation. Anyone have any ideas on how to get this all working ok?
5 Answers 5
without starting with the .;
You just uncomment the extension_dir in php.ini
Just for my future self if no-else. This is with PHP 5.2.13 running in Windows on IIS 8.
I got the following error:
PHP Warning: PHP Startup: Unable to load dynamic library ‘C:\Program Files (x86)\PHP\ext\php_openssl.dll’ — The specified module could not be found.
From phpinfo() the loaded php.ini file was C:\Program Files (x86)\PHP\php.ini .
The extension directory:
These were the last two lines of the php.ini file:
The php_openssl.dll and php_sqlsrv_52_nts_vc6.dll files are in the ext directory. The php_openssl.dll isn’t corrupt (it’s the same file size as one on another machine that’s working).
PHP will find the sqlsrv dll but not the openssl dll. No idea why. No amounts of IIS restarting did anything.
The solution until I know better was to install the openssl.dll extension using the Windows PHP installer. You can re-run the installer and select ‘Change’ and it allows you to add or remove libraries. I can’t see any difference in the file or the php.ini file now, but now the file loads.
I suspect actually that my problem was similar to this comment about OpenSSL installation on Windows:
At this point, when you start Apache it will attempt to load php_openssl.dll, but if your setup is anything like mine you will see an error. I prefer to start Apache manually, and the error appears in a dialog box: «The ordinal 4114 could not be located in the dynamic link library LIBEAY32.dll». (I’m not sure whether you would get this message if you started Apache as a service). The Apache log also contains an error message saying that php_openssl.dll cannot be loaded, though that message doesn’t name libeay32.dll. Welcome to DLL Hell.
Libeay32.dll enters the picture because php_openssl.dll depends on it (and also on ssleay32.dll). What I think happens is that Apache first tries to load php_openssl.dll programmatically from the path specified by the extension_dir key. But then, the loading of the so-called dependent DLLs is left to Windows’ default mechanism. If Windows finds an incompatible version of a dependent DLL, you get the error.
I noticed errors about ssleay32.dll when trying to run php -i from the command line. I just assumed that it didn’t have it in the environment. IIS made no mention of any ssleay32.dll errors in its logs.
Warning: PHP Startup: Unable to load dynamic library
I am currently hosting on 1und1.de. my codes work on localhost but upon uploading it on the shared hosting server i got the following errors:
What does these errors mean. does these errors have something to do with my hosting provider?
2 Answers 2
It looks as though you’ve probably copied your php.ini configuration file directly from your system to your hosting server. Don’t do that. The data in your configuration file is specific to your XAMPP installation; this is not appropriate for the web server, and is causing these errors because the files referenced in your configuration do not exist on the server.
Sometimes people here are not as they could be.
For whatever reason, your php.ini is mis-configured.
One thing to note that all those missing files are actually Windows files (*.dll) on Linux these would likely be *.so files. I’m assuming your hosting on a Linux server.
First find your php.ini file. If you have command line access via SSH, you can try running:
if not you make a simple script, call it test.php like so:
Upload the file and run it, something like:
Among the information provided will be the path to php.ini
Once you find it, one option is to edit it and comment out all those extensions, by putting a «;» in front of the line.
Another option is to check if the *.so files exist. Look for them under /usr/lib/php. If they exist, edit your php.ini file to have all those extension end in .so instead of .dll
Finally, if they don’t exist, you could install them by using apt-get or yum. An example:
PHP Startup: Unable to load dynamic library php_curl.dll
I am having trouble getting cURL working on one of my servers. I have others set up exactly like this and they are working. Here is the error message in the system log:
PHP Fatal error: Call to undefined function curl_init()
PHP Warning: PHP Startup: Unable to load dynamic library ‘C:\php\ext\php_curl.dll’ — The specified module could not be found. in Unknown on line 0
I’ve been researching this all day and nothing has worked. Here’s the current state of the server:
- php.ini is in C:\php\
- php_curl.dll is in C:\php\ext\
- libeay32.dll and ssleay32.dll are in C:\php\
- extension=php_curl.dll is uncommented in php.ini
- Environment variable PATH = %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C\php;C:\php\ext;C:\Apache24\bin
- phpinfo() shows that C:\php\php.ini is the config file being used
- php.ini extension_dir = «C:\php\ext»
- Apache is from here
- PHP is from here
- OS is Windows Server 2008 R2 Datacenter
I’ve restarted several times. Other extensions are loading from the extension directory. I’ve also tried re-downloading the PHP zip file and replacing C:\php with the contents of the freshly downloaded zip file. I had this problem on a different server a while back when I was updating PHP and Apache. Replacing C:\php with a new copy of the zip file did fix it, but it is not helping now.
I will be happy to provide any additional information you may need.