Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running PHP in Windows: how to fix "PHP Startup: Unable to load dynamic library" issues?

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'

?

like image 954
Don Korleone Avatar asked Aug 20 '14 22:08

Don Korleone


2 Answers

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.

like image 193
Sverri M. Olsen Avatar answered Sep 21 '22 08:09

Sverri M. Olsen


Adjust the following value in php.ini:

; Directory in which the loadable extensions (modules) reside.
extension_dir = "C:\path to extension directory"
like image 23
NoDataFound Avatar answered Sep 22 '22 08:09

NoDataFound