login button

Unable to load dynamic library wsf.dll

Forums :

I have attempted to install the 1.3.2 Windows Binary I downloaded from here:
http://wso2.org/downloads/wsf/php#binary-php

I'm pretty sure I've got all the dependencies covered including iconv.dll, libxml2.dll, zlib1.dll. I've added the path to these DLLs as well as the path to wsf_c/lib DLLs.

However, when I try to run any PHP scripts from the command line I get an error. Even a script that merely says "hello world":

C:\test>php test.php
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\
ext\wsf.dll' - This application has failed to start because the application conf
iguration is incorrect. Reinstalling the application may fix this problem.
 in Unknown on line 0
hello world
C:\test>

I am not sure why this happens because the file is clearly there:

C:\test>dir "C:\Program Files\PHP\ext\wsf.dll"
 Volume in drive C has no label.
 Volume Serial Number is 78FA-0847

 Directory of C:\Program Files\PHP\ext

06/04/2008  05:42 PM           176,128 wsf.dll
               1 File(s)        176,128 bytes
               0 Dir(s)  107,024,705,024 bytes free
C:\test>

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re:Unable to load dynamic library wsf.dll

Hi,
I addition to adding the dependency libraries to path and adding wsf_c/lib directory to the path, you need to put the following configurations in php.ini

wsf.home, wsf.log_path and wsf.rm_db_dir.

You can find all the details here is section 2.4.

http://www.wso2.org/project/wsf/php/1.3.2/docs/manual.html

Regards
Nandika

those were in the php.ini

I have also made all the requested changes to the php.ini file:

; added by jta per wso2/swf install instructions
include_path = ".;c:\wsf"

; added by JTA per WSO2/WSF instructions
extension=php_xsl.dll
extension=wsf.dll

; added by JTA per WSO2/WSF instructions
wsf.home="c:\wsf\wsf_c"
wsf.log_path="c:\wsf\wsf_c\logs"
wsf.log_level=3
wsf.rm_db_dir="c:\wsf\wsf_c"

The error is still the same.

FYI, The instructions I'm following are those provided with the binary distribution and they do not mention wsf.rm_db_dir. Adding that makes no difference. I have attached the install instructions.

I thought the problem might be that WSF was trying to access SSL functionality so I uncommented this line:

extension=php_openssl.dll

That only introduces another error relating to php_openssl.dll:

C:\test>php test.php
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\
ext\php_openssl.dll' - This application has failed to start because the applicat
ion configuration is incorrect. Reinstalling the application may fix this proble
m.
 in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\
ext\wsf.dll' - This application has failed to start because the application conf
iguration is incorrect. Reinstalling the application may fix this problem.
 in Unknown on line 0
hello world

AttachmentSize
README.INSTALL_WIN32.txt5.74 KB

Re:those were in the php.ini

well, WSF/PHP has a dependency on OpenSSL as well. Have you installed it ?

Regards
Nandika

It works with Apache, but not via command line

With some help from a friend, we managed to get our WSF script running if we access it via apache, HOWEVER we cannot invoke these scripts using the command line.

Some experimentation has yielded the following details:

1) Apache looks first in C:\Program Files\Apache Software Foundation\Apache2.2\bin for ssleay and libeay. If it doesn't find them there, it attempts to use the ones in C:\winnt\system32.

2) Apache works when it loads these versions of the DLLs:
SSLEAY32.DLL, 197KB, 1/17/2008
LIBEAY32.DLL, 1,045KB, 1/17/2008

3) If I replace those DLLS with the smaller versions dated 6/25/2008, then I get an error when I try to restart Apache. A dialog pops up titled "Error" that says "The requested operation has failed". I looked in the error log at C:\Program Files\Apache Software Foundation\Apache2.2\logs\error.log and found this:

[Sun Jul 27 15:38:19 2008] [notice] Parent: Received restart signal -- Restarting the server.
httpd.exe: Syntax error on line 119 of C:/Program Files/Apache Software Foundation/Apache2.2/conf/httpd.conf: Cannot load C:/Program Files/Apache Software Foundation/Apache2.2/modules/mod_ssl.so into server: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.  
[Sun Jul 27 15:38:19 2008] [notice] Child 956: Exit event signaled. Child process is ending.
[Sun Jul 27 15:38:19 2008] [warn] (OS 995)The I/O operation has been aborted because of either a thread exit or an application request.  : winnt_accept: Asynchronous AcceptEx failed.
[Sun Jul 27 15:38:19 2008] [warn] (OS 995)The I/O operation has been aborted because of either a thread exit or an application request.  : winnt_accept: Asynchronous AcceptEx failed.
[Sun Jul 27 15:38:20 2008] [notice] Child 956: Released the start mutex
[Sun Jul 27 15:38:21 2008] [notice] Child 956: All worker threads have exited.
[Sun Jul 27 15:38:21 2008] [notice] Child 956: Child process is exiting

Switching the DLLs back lets me successfully restart.

4) Trying to invoke PHP from the command line will not work at all when using the larger DLLS that work with Apache (dated 1/17/2008). The script simply will not run. There are no errors and there is no output from a 'hello world' script.

5) I can invoke my hello world script from the command line when using these DLLs:
SSLEAY32.DLL, 185KiB, 6/25/2008
LIBEAY32.DLL, 973KiB, 6/25/2008
HOWEVER the output of any script is always preceded by these errors

C:\crs\d>php test.php
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\
ext\php_openssl.dll' - This application has failed to start because the applicat
ion configuration is incorrect. Reinstalling the application may fix this proble
m.
 in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\
ext\wsf.dll' - This application has failed to start because the application conf
iguration is incorrect. Reinstalling the application may fix this problem.
 in Unknown on line 0

Additionally, my WSF script complains about failing to find certain classes:

PHP Fatal error:  Class 'WSPolicy' not found in C:\Program Files\Apache
Software Foundation\Apache2.2\htdocs\rodc\wsdl.php on line 15

I just don't understand why the same version of PHP will run a script fine using apache but the command line version of php somehow fails. It's also puzzling to me that php via apache can use a pair of DLLs and the command line simply cannot.

I have tried 3 variants of these DLLs on my computer in various places and I have alternately tried all 3 in the system 32 folder. None of them work. The versions dated 6/25/2008 result in the error about php_openssl.dll and wsf.dll, but the script otherwise runs -- i.e., I can actually see my 'hello world' output.

The other versions, dated 1/17/2008 and 11/8/2007, do not work. When I try to invoke my script, there is a pause while PHP is being initialized but the script will not run. There is no output and no error. Might this be related to CRT or KEY files not being found by CLI php?

Re: It works with Apache, but not via command line

WSF/PHP has a dependency on OpenSLL and some openssl versions are incompatible to each other. Therefore we have documented the OpenSSl versions we used to build the binary.

Regards
Nandika

where?

where?

The version numbers are

The version numbers are listed in README.INSTALL_WIN32 file.

I have tried both 0.9.8g and

I have tried both 0.9.8g and 0.9.8h from that exact page mentioned in that document:
http://www.slproweb.com/products/Win32OpenSSL.html

Your readme file mentions 0.9.8e which is not available from there.

Version 0.9.8g installs these files:
LIBEAY32.DLL - 10/22/2007, 1,015,808 bytes
SSLEAY32.DLL - 10/22/2007, 196,608 bytes
It prevents any script from running via the command line. When I attempt to run even the most rudimentary script (such as 'echo "hello world"; ' the script attempts to run but then exits without any output or error.

Version 0.9.8h installs these files
SSLEAY32.DLL, 185KiB, 6/25/2008
LIBEAY32.DLL, 973KiB, 6/25/2008
Any script run from the command line may well run but is preceded by these two errors:

C:\test>php test.php
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\
ext\php_openssl.dll' - This application has failed to start because the applicat
ion configuration is incorrect. Reinstalling the application may fix this proble
m.
 in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\
ext\wsf.dll' - This application has failed to start because the application conf
iguration is incorrect. Reinstalling the application may fix this problem.
 in Unknown on line 0

Any scripts using WSF complain about not being able to locate various classes.

I just can't seem to figure out what the problem is. I just downloaded some 0.9.8e binaries from here:
http://www.deanlee.cn/?p=60&cp=1
The problem is the same as with version g -- no script output, no errors.

Is there some kind of error log I can check to see where things are breaking down? Again, things run fine using apache but the command line just isn't working.

Hi, (1)  php_openssl is

Hi,

(1)  php_openssl is not used by WSF/PHP. so you can comment

extension=php_openssl.dll

 

(2) Since scripts are running when access through apache, openssl libraries available in apache seems to be correct version. So you can set "PATH" enviornment variable to include apache\bin as the first entry.

For command line :

set PATH=C:\Program Files\Apache Software Foundation\Apache2.2\bin;%PATH%

will do it. Then using that command prompt, you can run php scripts and see whether they are working.

 

To set the PATH permanently, you can goto system properties-> environment variables and set it.

 

Regards,

Shankar

SHANKAR! You are truly

SHANKAR! You are truly awesome!

I had tried copying various versions of LIBEAY32.DLL and SSLEAY32.DLL to the system32 folder because command-line PHP would look there first so I was skeptical of your suggestion. However, I tried it anyway. At first it didn't work because CLI PHP was still using the DLLS in the system 32 directory. When I renamed them, it fixed everything. Now it is working. I am guessing that more than just those two DLLs are required to get things working.

Thank you so much.

This is such a long thread...I'm not sure how to summarize what the fix is. It would be great to have an install-from-scratch tutorial for windows for folks who are not so familiar with a windows PHP environment like me.

Thanks so much for your help!

You are welcome

Hi,

You are welcome. Happy to hear it solved your problem.

Regards,
Shankar

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.