Thursday, January 24, 2008

Building WSF/PHP on Windows

Building WSF/PHP on Windows platform is quite straight forward provided that you have the necessary tools and the dependency software.
For building WSF/PHP you will need Microsoft Visual Studio. Else you can build using Windows platform SDK and Visual Studio Express edition.

I will list down the step by step process to building WSF/PHP on windows.

1. Download the dependencies.
1. Libxml2
2. Iconv
3. OpenSSL ( Download MSI installer )
4. PHP Source
5. PHP Binary
6. PHP Win32 Build tools. (Win32 build)
7. WSF/PHP source zip
8. Sqlite

2. Next Install OpenSSL.
3. Unzip all the binary dependencies.
4. Unzip WSF/PHP source. Eg E:\wso2-wsf-php-1.2.0
5. Go to E:\wso2-wsf-php-1.2.0 and open configure.in file.
6. Now you will see an option set like this.


DEBUG = 1
CRUNTIME=/MT
EMBED_MANIFEST=0
LIBXML2_BIN_DIR = E:\libxml2-2.6.30.win32
ICONV_BIN_DIR = E:\iconv-1.9.2.win32
ENABLE_SSL = 1
OPENSSL_BIN_DIR = E:\OpenSSL
WITH_SQLITE = 1
SQLITE_BIN_DIR = "E:\sqlite-3_3_81
SQLITE_SRC_DIR = "E:\sqlite-3_3_81"

PHP_SRC_DIR = E:\php\php-5.2.5
PHP_BIN_DIR = E:\php\php-5.2.5-Win32
WIN32BUILD_DIR = E:\php\win32build

I have removed the comments in the configure.in file. All you have to do is to edit these directory locations and set your corresponding directory locations.
If you want a debug build , set DEBUG option to 1.

7. open a command line.
Go to "C:\Program Files\Microsoft Visual Studio 8\VC\bin" directory and run the vcvars32.bat file. (Note: depending on your VC version, you might have a different location.)

8. Go to your WSF/PHP extract directory and run the build.bat file.

If you have set the directory paths correctly, WSF/PHP will be compiled and you will get the binary directory "wso2-wsf-php-bin-1.2.0-win32" built to the same directory.

Happy Compiling.

4 comments: