So I'm exploring the feability of installing the WSO WSF extension for PHP (holy acronyms!). The instructions are here:
http://wso2.org/project/wsf/php/1.3.2/docs/install_guide.html#2.Installing_and_Running_on_Microsoft_windows

It would appear that I have to perform all steps in section 2 (including 2.1, 2.2, 2.3, 2.4). Am I correct in understanding that to accomplish this I must have visual studio? Is there any way to do this without buying visual studio for $680 ?

Surely there is some kind of free sdk kit that will let me compile windows source?

    12 days later

    There's a list of prerequisites and also this statement in section 2.1:

    In addition you need to have Microsoft Visual Studio installed on your system.

    It's not clear to me whether I can skip past that section. The documentation is really pretty poor.

    Nog, you think you could handle this? I know it's poor form to solicit work on phpbuilder.com but I'm needing this done pretty badly. Perhaps someone could recommend a good way to find a talented, reputable PHP/Windows person?

      Is there a reason you're adamant about compiling it rather than using the binary download they offer?

        You guys have no idea how much of a noob I really am when it comes to the workings of windows. I just don't understand the path in those instructions that avoids compilation.

        Section 2.1 of those instructions lists dependencies and says "In addition you need to have Microsoft Visual Studio installed on your system."
        Section 2.2 Describes how to build the extension source code.
        Section 2.3 Describes how to build with PHP WIN32 Build System

        Section 2.4 (in very small print) says "You can get the binary pack by downloading and extracting the binary distribution as well." I did notice that on an early reading but only managed today to download the dependency DLLs -- at least I think so.

        In my defense, there are several different versions of the installation instructions, some of which point me to websites that offer no windows dll version. Also, some versions of the installation instructions don't describe a PHP Extension install but rather some kind of server daemon thing. Complicating matters is that zlib1.dll is required and I had to rename some other DLL that name (which is not mentioned at all in those instructions I linked above).

        Sometimes there's a readme.txt file and sometimes there is not. This particular one is not much help for a noob trying to install a PHP extension:

        libxml2 2.6.32


        This is libxml2, version 2.6.32, binary package for the native Win32/IA32
        platform.

        The files in this package do not require any special installation
        steps. Extract the contents of the archive whereever you wish and
        make sure that your tools which use libxml2 can find it.

        For example, if you want to run the supplied utilities from the command
        line, you can, if you wish, add the 'bin' subdirectory to the PATH
        environment variable.
        If you want to make programmes in C which use libxml2, you'll
        likely know how to use the contents of this package. If you don't, please
        refer to your compiler's documentation.

        If there is something you cannot keep for yourself, such as a problem,
        a cheer of joy, a comment or a suggestion, feel free to contact me using
        the address below.

                                  Igor Zlatkovic (igor@zlatkovic.com)

        So I tried running an older MSI installer (version 1.2.0). It didn't get my script running. It started asking for zlib1.dll so I decided it was time to start looking for dependencies. Long story short, I started trying many things and now my system is a bit of a mess I think and I almost have it working but no joy.

        When I run my script from the command line I get this:

        C:\crs\d>php d3.php
        Phase D3 commencing
        creating new WSPolicy
        PHP Fatal error:  Class 'WSPolicy' not found in C:\crs\d\d3.php on line 119
        

        As it turns out, that installer doesn't come with any PHP files. So I have uninstalled v1.2.0 and begun to look elsewhere. I'm not really sure where these dependency files should live.

        I have looked at the phpinfo() results and it looks like I have:
        iconv v 1.9
        libxml2 version 2.6.26
        zlib version 1.2.3

        But NO wsf. There is a reference in the pathext stuff to WSF:

        .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH

        I'm not sure if this is due to the original v.1.2.0 installer or my subsequent efforts downloading the latest windows binary.

        But I'm getting this error when I try to run a script using WSF stuff:

        I am LOST in determining what the heck is going on here.

        My phpinfo() results refer to WSFC_HOME which is a nonexistent directory:

        C:\Program Files\WSO2\WSFC\

        This appears to be left over from the original v1.2.0 installer I ran. The uninstall appears to have removed it.

        Anyways, I worry that I might be doing irreparable damage here. Could use a little help.

          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. NOTE: I am not at all sure about openSSL but there are no complaints about missing DLLs. I've added the path to these DLLs as well as the path to wsf_c/lib DLLs to the permanent PATH variable of the system.

          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 configuration
          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>
          

          Any help would be much much much appreciated. I've already posted this same thing on the WSO2 site and am waiting for a response.

            Wow, talk about a dependent little program!

            I managed to get it installed on my machine, but with after much tinkering.

            Some things to note: the .DLL files in the wsf_c\lib have to be in your system's PATH as well. Easy way to double check if a DLL is accessible is to go to Start -> Run and type in its name, e.g. axiom.dll (once of the DLLs in that folder). If you get an "Open With" screen, you're fine; if not, there's a path problem.

            Also make sure that you have zlib1.dll somewhere in your PATH (Google and download the DLL if you don't have it).

            If that doesn't work, let me know and I'll give you some debugging tools to see where exactly the DLL is failing to load.

              bradgrafelman;10878925 wrote:

              Wow, talk about a dependent little program!

              Yeah, Right??!

              Thanks so much for your tips. I tried the Start->Run->'axiom.dll' and got the open with... prompt. So the PATH appears to be cooperating. Just to be sure, here's the PATH:

              C:\Program Files\PHP\;C:\Program Files\Mail Enable\BIN;c:\Program Files\Support Tools\;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;c:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\wsf\wsf_c\lib;C:\bin;C:\OpenSSL\bin;C:\DOS;C:;C:\i386

              You can see C:\wsf\wsf_c\lib in there.

              I've got zlib1.dll in C:\bin and as you can see that's in the path too. Does it make any difference that my zlib1.dll used to be named zlipwapi.dll? I thought it was ok to do that due to this note in the readme for that particular dll:

              Note :
                The DLL, named zlibwapi.dll, is compatible to the old zlib.dll built
                by Gilles Vollant from the zlib 1.2.x sources, and distributed at
                  http://www.winimage.com/zLibDll
                It uses the WINAPI calling convention for the exported functions, and
                includes the minizip functionality. If your application needs that
                particular build of zlib.dll, you can rename zlibwapi.dll to zlib.dll.
              

              I'm wondering if that might be the problem.

                I downloaded zlib1.dll from this site and it worked for me.

                Try replacing that, and if that doesn't work, I'll give you a link to the DLL debugger I used and we can see what problems it reports.

                  I don't think zlib1.dll is the problem. I found a zlib1.dll in the apache/bin folder and tried that one and the problem is still the same.

                  I noticed that If I try enabling the php_openssl.dll extension in PHP.ini that I get an additional error. Specifically, when I remove the comment from this line in PHP.ini:

                  ;extension=php_openssl.dll

                  I get an additional error when running any php script at all from the command line, even this one that just echoes 'hello world' :

                  
                  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
                  
                  C:\test>pause
                  Press any key to continue . . .
                  

                  In my post at wso2.org, a rep for them has said that SSL is a 'dependency' of the WSF extension. Also, you'll note that the php_openssl.dll extension fails first. I'm thinking there's a problem with OpenSSL and the WSF extension is barfing (without any additional information) because it isn't happy with openSSL not being available.

                  Is there any kind of way to find out what might be wrong with openssl?

                    I tried your zlib1.dll and the problem is still the same.

                      You are THA MAN. That program rules. Who know such a thing was possible?

                      Apparently it's looking for MSVCR90.DLL and MSJAVA.DLL. Both appear to be Microsoft DLLs. Any thoughts on why they are missing or whether I could reasonably expect them to be on this Windows 2003 server?

                      There's also this text in the log window:

                      Error: The Side-by-Side configuration information for "c:\winnt\system32\LIBEAY32.DLL" contains errors. This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem (14001).
                      Error: The Side-by-Side configuration information for "c:\winnt\system32\SSLEAY32.DLL" contains errors. This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem (14001).
                      Error: At least one required implicit or forwarded dependency was not found.
                      Warning: At least one delay-load dependency module was not found.
                      

                        First thing I would suggest trying is to overwrite the two DLL's you see mentioned in that log (libeay32 and ssleay32) with the ones that come with PHP5 (e.g. in C:\Program Files\PHP). See if that doesn't get the extension to load.

                        If not, I'm not sure where MSVCR90.DLL is coming from (I don't have it on my system and I ran it fine) - it might be from the M$ VB runtime library. I do know, however, that MSJAVA.DLL is part of the M$ Java VM which is no longer distritubed (in favor of Sun's VM). You can try resolving that dependency by installing the M$ VM (link here) as others have kept it around.

                          The openssl situation appears to be a mess on this machine. I learned that another developer on this project has managed to get WSF working via apache. This is good news. However, I need some WSF scripts to run from the command line and I'm still getting that error when I run any PHP file.

                          There are no LIBEAY32 or SSLEAY32 dlls in the c:\program files\php folder. I am able to find several versions of each DLL on the machine:

                          === SSLEAY32.DLL ===
                          C:\OpenSSL, 185KiB, 6/25/2008
                          C:\OpenSSL\bin, 185KiB, 6/25/2008
                          C:\WINNT\system32, 185KiB, 6/25/2008
                          C:\Program Files\Apache Softare Foundation\Apache2.2\bin, 197KB, 1/17/2008
                          
                          185KiB files are 188,928 bytes
                          197KiB files are 200,774 bytes
                          
                          Then there is a folder with php-5.2.2-Win32 zip in it which contains a version that is 196Kib (200,704 bytes -- 70 bytes less than that other one) dated 11/8/2007.
                          
                          
                          === LIBEAY32.DLL ===
                          C:\OpenSSL, 973KiB, 6/25/2008
                          C:\OpenSSL\bin, 973KiB, 6/25/2008
                          C:\WINNT\system32, 973KiB, 6/25/2008
                          C:\Program Files\Apache Softare Foundation\Apache2.2\bin, 1,045KB, 1/17/2008
                          
                          973KiB files are 996,352 bytes
                          1,045KiB files are 1,069,126 bytes
                          
                          Then one in the php-5.2.2-Win32 zip that is 1,072Kib (1,097,728 bytes) dated 11/8/2007.
                          

                          I have recently run the installer for OpenSSL 0.9.8h and I'm pretty sure that installed all the stuff that lives in C:\OpenSSL.

                          HOWEVER, when I run phpinfo() I get various references to two different versions of openSSL, 0.9.8e and 0.9.8g.

                          === apache2handler ===
                          Apache Version: Apache/2.2.8 (Win32) mod_ssl/2.2.8 OpenSSL/0.9.8g PHP/5.2.5

                          === Apache Environment ===
                          SERVER_SOFTWARE" Apache/2.2.8 (Win32) mod_ssl/2.2.8 OpenSSL/0.9.8g PHP/5.2.5

                          === openssl ===
                          OpenSSL support: enabled
                          OpenSSL Version: OpenSSL 0.9.8e 23 Feb 2007

                          === PHP Variables ===
                          _SERVER["SERVER_SOFTWARE"]: Apache/2.2.8 (Win32) mod_ssl/2.2.8 OpenSSL/0.9.8g PHP/5.2.5

                          I don't really know which of these are being used and which are totally extraneous. I really don't want to break anything. It would appear that dependency walker thinks the ones in c:\winnt\system32\ are the ones that matter. I can rename the DLLs found there and try a different one it its place. Any idea which? Will I need to restart the server? Remember, I'm trying to run these scripts from the command line. You've been a great deal of help so far. Any ideas would be most helpful.

                            Some experimentation has yielded the following empirical data
                            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.

                              Good lord, I didn't figure it would be this complicated. :p

                              Try overwriting the two DLL's in the system32 folder with copies of the 0.98e DLL's, presumably in C:\OpenSSL or somewhere nearby?

                                I have tried all 3 variants of these DLLs 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.

                                As far as I can tell, neither Apache nor CLI tries to access anything in the C:\openssl folder. This folder was created when I used the openssl install here. The DLLs in that folder are dated 6/25/2008.

                                Might this have something to do with some CRT and/or KEY files? Like when the DLLs run they go looking for these files (which i know almost nothing about) in some relative path which makes sense for Apache but not CLI? Is there an error log I can check that might explain why CLI invocation is failing?

                                  I have fixed the problem thanks to a post on the wso2.org website.

                                  The fix was to prepend the Apache bin folder (C:\Program Files\Apache Software Foundation\Apache 2.2\bin) to the system path and deleting the LIBEAY32.DLL and SSLEAY32.DLL from the system32 folder. Why this works, I have no idea. I'm guessing that those two DLLs may have other dependencies which live in the Apache bin folder but don't exist in the system32 folder - or something like that.

                                  At any rate, it's working now. My path looks like this:

                                  C:\Program Files\Apache Software Foundation\Apache2.2\bin;C:\Program Files\
                                  PHP\;C:\Program Files\Mail Enable\BIN;c:\Program Files\Support Tools\;C:\WINNT\s
                                  ystem32;C:\WINNT;C:\WINNT\System32\Wbem;c:\Program Files\Microsoft SQL Server\90
                                  \Tools\binn\;C:\wsf\wsf_c\lib;C:\bin;C:\OpenSSL\bin;C:\DOS;C:;C:\i386
                                  
                                    Write a Reply...