How to Setup WSO2 WSF/PHP Build Environment on Windows XP

  • By Dushshantha Chandradasa
  • |
  • 22 Aug, 2008

Applies To

WSO2 WSF/PHP Version 1.3.2 and above
Platform Windows XP

 

 

 

Introduction

WSO2 Web Services Framework for PHP (WSO2 WSF/PHP) is the PHP extension of WSO2 WSF/C. As this is a rapidly evolving piece of software, you will need to get the latest source code and build it yourself to get some of the most recently added functionality that are not included in the last release. It is always important to have the correct build environment set, before performing a WSO2 WSF/PHP build successfully.

This process involves the following few steps:

  1. Download dependencies
  2. Install the Web server, PHP and other necessary software
  3. Setting up the system path
  4. Building WSO2 WSF/PHP

Let's now discuss these steps in detail.

1. Download Dependancies

In order to build WSO2 WSF/PHP you need the following dependancies ready to install. I assume that you already have Microsoft Visual Studio 2005 installed on your machine.

In order to use SSL support with WSO2 WSF/PHP, you need to install Apache HTTPD which is OpenSSL enabled. Make sure to download the MSI which is OpenSSL enabled. Also, Make note of the OpenSSL version it is built with. You need to download the same version of OpenSSL later.

Using an MSI installer will avoid the pain of having to configure PHP with HTTPD server. So, make sure to download the MSI.

In order to build WSO2 WSF/PHP, you need PHP header files that are included in the PHP source distribution. It is always better to have the source code of the same version as the binary distribution of the PHP you downloaded earlier. But nevertheless, any minor changes in the versions should not hopefully cause any problems, as the PHP API is pretty stable.

When you download OpenSSL, it is very important to download the same version of OpenSSL with which the Apache HTTPD server is built. A minor version difference may course absurd DLOpen errors during runtime.

Download the latest version.

Download the latest version.   

Download the latest version.  

2. Install the Web server, PHP and Other Necessary Software

Now that you have all the required tools to proceed with the installation of your Web server and other software, Let's start step by step.

  •  Install Apache HTTPD server on your system.

Double click the HTTPD MSI installer and it will install the software on your system. Follow the on-screen instructions carefully. You can install HTTPD to any location you like on your hard drive. The default location will be C:\Program Files\Apache Software Foundation\Apache2.2 .

  •  Install PHP on your system.

Its always easy to use an MSI intaller for this. It will configure PHP with your Aapache server automatically, so you don't have to warry about it. When you install with the MSI, please make sure to install php_xsl extention and pear. You can direct the installer to do this by ticking these components in the custom installation section. php_xsl extention will be used by WSO2 WSF/PHP and pear is a tool that helps you to run automated tests in WSO2 WSF/PHP. And please note that it is always better to install PHP in a folder where the folder path does not include any spaces. For example, It is always better to install php in C:\PHP directory than C:\Program Files\PHP. This will save you from some of the untraceable errors that pops us with the pear tool. If you are using a binary zip file for PHP, you will have to configure PHP with Apache server manually. Also add the following entries to your Apache httpd.conf file. This file can be found in the conf folder of your Apache installation folder. Again, note, that you do not need to add those manually, provided you installed PHP from the MSI.

    PHPIniDir "C:/PHP/"
    LoadModule php5_module "C:/PHP/php5apache2_2.dll"
    AddType application/x-httpd-php .php .phtml
    AddType application/x-httpd-php-source .phps

  •  Install OpenSSL

If you already have installed an older version of OpenSSL, please uninstall it before you install the new one. Double clicking the MSI installer file will install OpenSSL into your system. If the installer asked whether to replace the older dlls please answer "yes". 

  •  Setup other required software

Now, extract the PHP source distribution, libxml2, iconv and win32build packages into your hard drive. These are required to build WSF/PHP on your system.

3. Setting up the System path

Now, you have all the software and libraries you need to build WSF/PHP. The next step is to make them available to system whenever the system needs them. To do that we setup the system path of your system. Add the bin folders of your libxml2 and iconv libraries into the your machines system path. And in order to use PHP and pear on the command line, add the PHP bin dir also into your system path.

4. Build WSF/PHP

Now, you are ready to download and build WSO2 WSF/PHP on your machine. You can download the latests version of WSO2 WSF/PHP from the Oxygen Tank PHP download page, or, you can get the latest nightly build from here. You can now follow the installation guide to build WSO2 WSF/PHP in this build environment.

Summary

In this Tutorial, I discussed, step by step, how you can setup your Windows XP environment to successfully build WSO2 WSF/PHP source code, the simple things that cause problems and how to avoid them.

Author

Dushshantha Chandradasa, Senior Software Engineer- QA, dushshantha at wso2 dot com

 

About Author

  • Dushshantha Chandradasa
  • Senior Engineer - Software Engineering
  • Highmark Health Services