Windows php warning php startup unable to load dynamic library

I have determined path to php folder and trying to run some php file and getting this message from command line.

Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.

C:\Users\U1>php
Failed loading \usr\local\php5\ext\php_xdebug-2.2.0-5.3-vc9.dll
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/php5/ext\php_curl.dll' - The specified module could not be found.
 in Unknown on line 0
<!--error-->
Warning: PHP Startup: Unable to load dynamic library '/usr/local/php5/ext\
php_curl.dll' - The specified module could not be found.
 in Unknown on line 0
<script language=JavaScript src='/denwer/errors/phperror_js.php'></script>PHP Wa
rning:  PHP Startup: Unable to load dynamic library '/usr/local/php5/ext\php_gd2
.dll' - The specified module could not be found.
 in Unknown on line 0
<!--error-->
Warning: PHP Startup: Unable to load dynamic library '/usr/local/php5/ext\php_gd
2.dll' - The specified module could not be found.
 in Unknown on line 0
<script language=JavaScript src='/denwer/errors/phperror_js.php'></script>PHP Wa
rning:  PHP Startup: Unable to load dynamic library '/usr/local/php5/ext\php_mbstring.dll' - The specified module could not be found.
 in Unknown on line 0
<!--error-->
Warning: PHP Startup: Unable to load dynamic library '/usr/local/php5/ext\php_mb
string.dll' - The specified module could not be found.
 in Unknown on line 0
<script language=JavaScript src='/denwer/errors/phperror_js.php'></script>PHP Wa
rning:  PHP Startup: Unable to load dynamic library '/usr/local/php5/ext\php_mysql.dll' - The specified module could not be found.
 in Unknown on line 0
<!--error-->
Warning: PHP Startup: Unable to load dynamic library '/usr/local/php5/ext\php_my
sql.dll' - The specified module could not be found.
 in Unknown on line 0
<script language=JavaScript src='/denwer/errors/phperror_js.php'></script>PHP Wa
rning:  PHP Startup: Unable to load dynamic library '/usr/local/php5/ext\php_mys
qli.dll' - The specified module could not be found.
 in Unknown on line 0
<!--error-->
Warning: PHP Startup: Unable to load dynamic library '/usr/local/php5/ext\php_my
sqli.dll' - The specified module could not be found.
 in Unknown on line 0
<script language=JavaScript src='/denwer/errors/phperror_js.php'></script>PHP Wa
rning:  PHP Startup: Unable to load dynamic library '/usr/local/php5/ext\php_pdo
_mysql.dll' - The specified module could not be found.
 in Unknown on line 0
<!--error-->
Warning: PHP Startup: Unable to load dynamic library '/usr/local/php5/ext\php_pd
o_mysql.dll' - The specified module could not be found.
 in Unknown on line 0
<script language=JavaScript src='/denwer/errors/phperror_js.php'></script>PHP Wa
rning:  PHP Startup: Unable to load dynamic library '/usr/local/php5/ext\php_pdo
_sqlite.dll' - The specified module could not be found.
 in Unknown on line 0
<!--error-->
Warning: PHP Startup: Unable to load dynamic library '/usr/local/php5/ext\php_pd
o_sqlite.dll' - The specified module could not be found.
 in Unknown on line 0
<script language=JavaScript src='/denwer/errors/phperror_js.php'></script>PHP Wa
rning:  PHP Startup: Unable to load dynamic library '/usr/local/php5/ext\php_sql
ite.dll' - The specified module could not be found.
 in Unknown on line 0
<!--error-->
Warning: PHP Startup: Unable to load dynamic library '/usr/local/php5/ext\php_sq
lite.dll' - The specified module could not be found.
 in Unknown on line 0
<script language=JavaScript src='/denwer/errors/phperror_js.php'></script>PHP Wa
rning:  PHP Startup: Unable to load dynamic library '/usr/local/php5/ext\php_soa
p.dll' - The specified module could not be found.
 in Unknown on line 0
<!--error-->
Warning: PHP Startup: Unable to load dynamic library '/usr/local/php5/ext\php_so
ap.dll' - The specified module could not be found.
 in Unknown on line 0
<script language=JavaScript src='/denwer/errors/phperror_js.php'></script>PHP Wa
rning:  PHP Startup: Unable to load dynamic library '/usr/local/php5/ext\php_sql
ite3.dll' - The specified module could not be found.
 in Unknown on line 0
<!--error-->
Warning: PHP Startup: Unable to load dynamic library '/usr/local/php5/ext\php_sq
lite3.dll' - The specified module could not be found.
 in Unknown on line 0
<script language=JavaScript src='/denwer/errors/phperror_js.php'></script>PHP Wa
rning:  PHP Startup: Unable to load dynamic library '/usr/local/php5/ext\php_xsl
.dll' - The specified module could not be found.
 in Unknown on line 0
<!--error-->
Warning: PHP Startup: Unable to load dynamic library '/usr/local/php5/ext\
php_xsl.dll' - The specified module could not be found.
 in Unknown on line 0
<script language=JavaScript src='/denwer/errors/phperror_js.php'></script>
^A

All libraries are open on php.ini file. I have checked them all. I am wondering why command line tries to run library in incorrect path like

'/usr/local/php5/ext\php_xsl.dll'

Does it should be like

'/usr/local/php5/ext/php_xsl.dll'

?

ROMANIA_engineer's user avatar

asked Aug 20, 2014 at 22:14

Don Korleone's user avatar

1

Open your php.ini file and set the following setting to a Windows file path:

extension_dir = "X:/path/to/your/php/ext"

On Windows, paths that point to something on a normal hard drive have to start with a letter and then a colon, like «C:«. Paths that start with a forward slash, /, are Unix-like paths, and will not work on Windows.

answered Aug 20, 2014 at 23:16

Sverri M. Olsen's user avatar

Sverri M. OlsenSverri M. Olsen

13.1k3 gold badges36 silver badges52 bronze badges

1

Adjust the following value in php.ini:

; Directory in which the loadable extensions (modules) reside.
extension_dir = "C:\path to extension directory"

answered Aug 20, 2014 at 22:29

NoDataFound's user avatar

NoDataFoundNoDataFound

11.4k34 silver badges59 bronze badges

0

You can also specify the extensions directory without using the full path if it’s in the same folder, at least in PHP 7.2.5 (have not tested other versions).

Example:

extension_dir = "ext"

Where ext is your extensions directory.

answered May 22, 2018 at 14:46

Optimae's user avatar

OptimaeOptimae

9421 gold badge12 silver badges23 bronze badges

I have 7.4 php version. I solved this by uncommenting the following line by removing ; inside the php.ini file.

extension_dir = "ext"

Note that initially, if you won’t have php.ini file you should first copy and paste php.ini-development file and rename it as php.ini.

answered Dec 28, 2022 at 13:22

oybek's user avatar

oybekoybek

391 bronze badge

Check the dll / library path from the error and make sure it’s correct.
Updating /php.ini-> extension_dir to the correct path solves my problem.

answered Aug 31, 2021 at 6:15

BAA's user avatar

0

Если при запуске PHP приложения в ОС Windows выдается сообщение типа «PHP Warning:  PHP Startup: Unable to load dynamic library ‘pdo_sqlite’ (tried: C:\php\ext\pdo_sqlite (The specified module could not be found.), C:\php\ext\php_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:\usr\bin\php7\ext»

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

extension=pdo_sqlite

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


No comments yet.

Answer by Archie Stein

I have determined path to php folder and trying to run some php file and getting this message from command line.,All libraries are open on php.ini file. I have checked them all. I am wondering why command line tries to run library in incorrect path like,Open your php.ini file and set the following setting to a Windows file path:,

Podcast 392: Do polyglots have an edge when it comes to mastering programming…

Open your php.ini file and set the following setting to a Windows file path:

extension_dir = "X:/path/to/your/php/ext"

Answer by Karter Franco

I had the same problem on XAMPP for Windows10 when I try to install composer.,I had the same problem on XAMPP for Windows when I try to install composer.
I did php -v and php throwing error :,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: ,now again start the composer installation progress, i think your problem will be solved.

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

Answer by Wayne Moody

After upgrade to PHP 7.1 i have a problem with loading these two files:,https://github.com/Microsoft/msphpsql/releases/download/4.1.4-Windows/7.1.zip,@klapsius did you try php_sqlsrv_71_nts* ones?
https://github.com/Microsoft/msphpsql/releases/download/4.1.4-Windows/7.1.zip,On the releases page https://github.com/Microsoft/msphpsql/releases I can’t see any mention of 7.1

PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\v7.1\ext\php_sqlsrv_7_nts_x86.dll' - The specified procedure could not be found.
 in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\v7.1\ext\php_pdo_sqlsrv_7_nts_x86.dll' - The specified procedure could not be found.
 in Unknown on line 0

Answer by Salem Hoover

How can I fix this PHP Startup issue?,As Darren commented, Apache don’t understand php.ini relative paths in Windows.,The only idea that comes to mind is setting an environment variable:,If the above is true, then the parser is not recognising phpMyAdmin/index.php as a php file, for some reason. Try reinstalling phpMyAdmin.

But, PHP is not working as it should. In the error.log file from the Apache server I get the warning listed below

PHP Warning:  PHP Startup: Unable to load dynamic library 'ext\php_curl.dll' - The specified module could not be found.rn in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'ext\php_ldap.dll' - The specified module could not be found.rn in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'ext\php_mysql.dll' - The specified module could not be found.rn in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'ext\php_mysqli.dll' - The specified module could not be found.rn in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'ext\php_openssl.dll' - The specified module could not be found.rn in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'ext\php_pdo_mysql.dll' - The specified module could not be found.rn in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'ext\php_sqlsrv_55_ts.dll' - The specified module could not be found.rn in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'ext\php_pdo_sqlsrv_55_ts.dll' - The specified module could not be found.rn in Unknown on line 0

The PHP extensions are located in

C:phpext

Inside the file php.ini I have this variable

extension_dir = "ext"

here is a directory listing of the ext folder

 Volume in drive C is OS
 Volume Serial Number is C63C-1D75

 Directory of C:phpext

07/29/2014  06:42 PM    <DIR>          .
07/29/2014  06:42 PM    <DIR>          ..
04/30/2014  02:46 PM            66,560 php_bz2.dll
04/30/2014  02:46 PM            72,704 php_com_dotnet.dll
04/30/2014  02:46 PM           507,392 php_curl.dll
04/30/2014  02:46 PM            18,944 php_enchant.dll
04/30/2014  02:46 PM            43,008 php_exif.dll
04/30/2014  02:46 PM         2,679,808 php_fileinfo.dll
04/30/2014  02:46 PM         1,358,848 php_gd2.dll
04/30/2014  02:46 PM            40,960 php_gettext.dll
04/30/2014  02:46 PM           240,128 php_gmp.dll
04/30/2014  02:46 PM           831,488 php_imap.dll
04/30/2014  02:46 PM            65,024 php_interbase.dll
04/30/2014  02:46 PM           261,632 php_intl.dll
04/30/2014  02:46 PM           179,200 php_ldap.dll
04/30/2014  02:46 PM         1,239,552 php_mbstring.dll
04/30/2014  02:46 PM            36,864 php_mysql.dll
04/30/2014  02:46 PM            88,576 php_mysqli.dll
04/30/2014  02:46 PM           141,824 php_oci8.dll
04/30/2014  02:46 PM           142,336 php_oci8_11g.dll
04/30/2014  02:46 PM           120,320 php_opcache.dll
04/30/2014  02:46 PM            72,704 php_openssl.dll
04/30/2014  02:46 PM            21,504 php_pdo_firebird.dll
04/30/2014  02:46 PM            24,576 php_pdo_mysql.dll
04/30/2014  02:46 PM            23,040 php_pdo_oci.dll
04/30/2014  02:46 PM            20,480 php_pdo_odbc.dll
04/30/2014  02:46 PM            27,648 php_pdo_pgsql.dll
04/30/2014  02:46 PM           465,408 php_pdo_sqlite.dll
08/28/2012  04:15 PM           186,520 php_pdo_sqlsrv_54_ts.dll
06/26/2013  03:22 PM           166,400 php_pdo_sqlsrv_55_ts.dll
04/30/2014  02:46 PM            90,112 php_pgsql.dll
04/30/2014  02:46 PM            12,288 php_shmop.dll
04/30/2014  02:46 PM           385,536 php_snmp.dll
04/30/2014  02:46 PM           236,544 php_soap.dll
04/30/2014  02:46 PM            54,784 php_sockets.dll
04/30/2014  02:46 PM           617,472 php_sqlite3.dll
08/28/2012  04:15 PM           204,952 php_sqlsrv_54_ts.dll
06/26/2013  03:22 PM           183,296 php_sqlsrv_55_ts.dll
04/30/2014  02:46 PM            31,744 php_sybase_ct.dll
04/30/2014  02:46 PM           236,544 php_tidy.dll
04/30/2014  02:46 PM            51,712 php_xmlrpc.dll
04/30/2014  02:46 PM           231,936 php_xsl.dll
              40 File(s)     11,480,368 bytes
               2 Dir(s)  83,103,895,552 bytes free

Answer by Allen Curtis

Running on Windows XP,Well that library could be corrupt. I would try downloading the .dll again and seeing if it solves the problem.,I’ve got the exact same problem.,Hi guys I figured this one out. I’m running Windows XP Professional & IIS 6

Oh!! Almost forgot, you need to comment the following field in php.ini (the one in the main apache directory, if it’s there, or, the one in the WINDOWS directory):

;mysql.default_port=

Answer by Milan Avalos

I cannot install anything using apt or dpkg because all packages are broken. I don’t know how to fix this issue and any ideas or guide will be appreciated.,I currently run php 7.2 and I believe this issue started when I wanted to install php 7.3 and it failed. Apache server, Yii2 framework,Anytime this error is returned, my server request fails and hence my system fail. ,

Your question has been posted! Share it with others to increase its visibility and to get it answered quickly.

Can you try removing your pdo_pgsql PHP driver with apt to see if that would work first:

apt remove pdo_pgsql

or

apt remove php-pgsql

You might need to add the version are using 7.3

apt remove php73-pgsql

Answer by Maci Mahoney

I suspect actually that my problem was similar to this comment about OpenSSL installation on Windows:,Just for my future self if no-else. This is with PHP 5.2.13 running in Windows on IIS 8.,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.,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).

Try this:

extension_dir = "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/php/ext/"

The extension directory:

extension_dir ="C:\Program Files (x86)\PHP\ext"

These were the last two lines of the php.ini file:

[PHP_SQLSRV]
extension=php_sqlsrv_52_nts_vc6.dll
[PHP_OPENSSL]
extension=php_openssl.dll

The PHP warning unable to load dynamic library occurs when PHP can’t load a required extension.

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:

PHP Warning:  PHP Startup: Unable to load dynamic library 'mysqli' 

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:

extension_dir="C:\xampp\php\ext"

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! 👍

I am using Apache 2.2 server, PHP 5.3.6 on a Windows 7 OS running on a 64-bit system.

On starting Apache server, this error appears in the apache error log-

PHP Warning: PHP Startup: Unable to load dynamic library ‘D:\php5\ext\php_curl.dll’ — The specified module could not be found.\r\n in Unknown on line 0

Following are the other extensions mentioned in the php.ini file —

extension=php_curl.dll
extension=php_gd2.dll
extension=php_mbstring.dll 
extension=php_mysql.dll
extension=php_xsl.dll
extension=php_memcache.dll

Echoing phpinfo() does not show the curl extension loaded, but the others are loaded.

The php_curl.dll file is however present in the correct location along with the others —
D:\php5\ext\php_curl.dll

phpinfo() shows that

extension_dir = D:\php5\ext

So, that also is correct.

Some more details

I am a new member in this team and I had setup Apache, PHP separately on this Windows 7 system and everything was working fine.

Our project needed a lots of httpd conf changes, so I was asked to simply overwrite the httpd conf file with the team’s current version. I did the same and just changed the ServerName, ServerAdmin etc. I also copied their PHP installation directory.

Everything other than this extension is working fine.

  • Windows portable devices что это за программа и нужна ли она
  • Windows photo viewer что это за программа и нужна ли она
  • Windows powershell грузит процессор windows 10
  • Windows photo viewer windows 2012
  • Windows portable devices что это за папка