19

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'

?

1
  • 2
    It's ovious that /usr/local/php5/...is a ...nix path and not an Window$ path. Adjust your php.ini settings (extensions) according to your installation. Search for the php_xls.dll on your disks, and you probably have the proper path for the extensions. Commented Aug 20, 2014 at 22:19

6 Answers 6

37

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.

Sign up to request clarification or add additional context in comments.

1 Comment

HI Thanks It helped and my script now running, but i am receiving this next msg abt dll not found: C:\Users\U1>php -f "z:\home\magento.dev\www\hello.php" Failed loading \usr\local\php5\ext\php_xdebug-2.2.0-5.3-vc9.dll Hello World C:\Users\U1>
5

Adjust the following value in php.ini:

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

Comments

5

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.

Comments

4

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.

Comments

1

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.

Comments

0

It worked for me to change the version of the library, I used the last one (1.19.2 for PHP 8.2.1) but I solved it by changing to 1.19.0

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.