Install WSF/PHP with WAMPServer

Formerly I have written several guidelines to install wsf/php in Linux like Installing WSF/PHP 1.2.1 in ubuntu and Install WSF/PHP 1.2.1 with zend core in Ubuntu 7.10. So I thought to prepare a similar guideline for windows specially with my favorite wamp software wampserver.

  1. Download wampserver from http://www.wampserver.com. and install. The installation can be done completely using the GUI installer and it is straightforward. I install it in the default directory, C:\wamp. My wampserver version is 2.0, but i think this guide should work for most of the versions near 2.0 as well.
  2. Download wso2 wsf/php windows binary from http://wso2.org/projects/wsf/php. It is 1.3.2 when I’m writing this.
  3. Extracted the binary in to a local directory. I extract the wso2-wsf-php-bin-1.3.2-win32.zip to the C:\software directory where I normally put my software.
  4. Download the iconv and libxml2 windows libraries from http://www.zlatkovic.com/pub/libxml/
  5. Extract them in a local directory. I m extracting it to my C:\software directory

    Note: So after the above steps I have following directories. So if you follow this correctly you should also have a similar directory structure.

    C:\wamp

    C:\software\wso2-wsf-php-bin-1.3.2-win32

    C:\software\libxml2-2.6.30.win32

    C:\software\iconv-1.9.2.win32

  6. Copy the wsf.dll file to the wamp php extension directory. So if you follow the same path I used to install the software you can copy the “C:\software\wso2-wsf-php-bin-1.3.2-win32\wsf.dll” to “C:\wamp\bin\php\php5.2.6\ext” directory straightaway. Adjust your paths according to your installation directories.
  7. Now you have to find the php.ini to set the configuration of wsf/php. If you are running wamp you can find the wampserver icon in the left hand side of the task bar.

    click the wampserver icon -> go to PHP menu -> click php.ini and the php.ini will be opend.

    Add the following entries to the end of the file. (The path should be changed to your installation directory locations)

    [wsf]
    wsf.home=”C:\software\wso2-wsf-php-bin-1.3.2-win32\wsf_c”
    wsf.log_path=”C:\software\wso2-wsf-php-bin-1.3.2-win32\wsf_c\logs”
    wsf.log_level=3

    extension=wsf.dll

    include_path=”.;C:\software\wso2-wsf-php-bin-1.3.2-win32\scripts”

  8. Enable the xsl extension. This can also be done using the wamp server icon in the left hand side of the task bar

    Wampserver icon -> PHP -> PHP Extensions -> php_xsl (you may have to scroll down to find the entry and make sure it is ticked)

  9. Then you should add the libxml2, iconv and wsf/c libraries to the ‘PATH’ environment variable. This can be done using the windows GUI.

    Right click My Computer -> click Properties -> Go to the ‘Advanced’ tab -> click ‘Environment Variables’

    There you can see the list of user variables and system variables. In the ‘system variables’ there should be an entry for the ‘path’ variable. If it exist select that entry and click the edit button, if not click the new butto and add the variable name ‘path’ Note that you should not add the paths in to user variables since Wamp will never load user variables at the statup.

    I added the following directories to the path variable separating them with semi colons. Again the locations can be changed depend on where you installed wsf/php.

    C:\software\libxml2-2.6.30.win32\bin

    C:\software\iconv-1.9.2.win32\bin

    C:\software\wso2-wsf-php-bin-1.3.2-win32\wsf_c\lib

    So for me the dialog box the path variable looks like this,

    Variable name: Path

    Variable value: <some early libraries for other binaries>…..;C:\software\wso2-wsf-php-bin-1.3.2-win32\wsf_c\lib;C:\software\libxml2-2.6.30.win32\bin;C:\software\iconv-1.9.2.win32\bin

    Unfortunately to be loaded ‘system variable’ by wamp, you have to restart the system. So just do a restart.

  10. Next time you start the wampserver you should see the wsf extension ticked in the GUI. Now copy the wsf/c sample directory to the www directory. In my computer it is copying ‘C:\software\wso2-wsf-php-bin-1.3.2-win32\samples’ to ‘C:\wamp\www’.

    Try some samples in “http://localhost/samples” from browser. And you just installed wsf/php in WAMPServer..

This entry was posted in web services, wsf/php, wso2 and tagged , , , . Bookmark the permalink.

11 Responses to Install WSF/PHP with WAMPServer

  1. Ramanath says:

    Hi,
    After following your steps, I got this:
    Message = ws client create failed
    how do I overcome this?
    Please help
    Thanks
    Ramanath

  2. dimuthu says:

    Hi Ramanath,
    Looks like wsf is not installed properly. And it can be one of the above steps that you have missed. I feel it should be a problem of library dependency. Can you please raise a question on the WSF/PHP forum with the information like your apache and php error_logs.

    Before that you may take a look at this checklist FAQ for WSF/PHP Installation and figure out the problem yourself (specially the point 5).

    Thanks
    Dimuthu

  3. M K says:

    Hi Dimuthu,

    Thanks a million for this document. It was extremely helpful in setting up everything right. 🙂 Much appreciate your work.

    Regards,
    MK

  4. Anno says:

    I installed properly and I can see the extension too, but when I click on the run client I could see “Message = ws client create failed ” why is that?

  5. dimuthu says:

    Hi,
    If the wsf is loaded, there should be a log file created. Sometime that may contain the reason to fail ws client creation. Please check that.

    Thanks
    Dimuthu

  6. Ratna says:

    Hi

    I followed all the instruction that you have mentioned,above but I get this error Fatal error: Class ‘WSClient’ not found.While going through FAQ blog in step 5 you had mentioned “Check your libxml, iconv and openssl libraries are actually in the PATH, if not just set it and try”.But in the installation you have not mentioned anything about
    openssl libraries?

  7. dimuthu says:

    Hi,
    I didn’t specially mentioned openssl in wamp scenario because wamp is coming with an inbuilt openssl which we can use in wsf/php as well. But there can be version incompatibilities between the openssl used to build wsf/php and comes with wamp in which case either you have to
    1. compile wsf/php for the available openssl version,
    2. download the openssl compatible with compiled wsf/php (AFAIK it is openssl 0.9.8e).

    But note that this situation is very rare. in such case I prefer to check the dependencies of libraries using ‘depends.exe’ and find what is missing..

    Thanks
    Dimuthu

  8. Sach says:

    Hi, i have been looking trying to install this in Mac OS X leopard using MAMP, but no success…following the linux install instructions. –cant find libxml-2.0–, have you installed WSF/PHP on OS X? any tips would be greatly appreciated.

  9. dimuthu says:

    Hey,
    I’ve not worked with MAC OS. So I can’t exactly tell where it is wrong.
    Please follow this http://www.dimuthu.org/blog/2008/07/24/faq-for-wsfphp-installation/ check whether it has an answer for your problem.

    Thanks
    Dimuthu

  10. Alexandre says:

    I have followed all the steps, but I got the message:

    Fatal error: Class ‘WSClient’ not found in C:\wamp\www\samples\echo_client.php on line 24

    can you help me?

Leave a Reply

Your email address will not be published. Required fields are marked *