This document guides you on how to install the WSO2 Web Services Framework/PHP extension, and run the server and client samples on Linux and Microsoft Windows operating systems.
Please send your feedback to the user mailing list: wsf-php-user@wso2.org. subcribe
Inorder to build and run the WSF/PHP Linux source distribution, you need to have the following software installed on your system.
1. Go to the directory where you have extracted the source distribution. Run the following:
Note: You may require super user privileges to run 'make install' on your system.
2. After installing the extension, you have to edit the php.ini file and
add the following line to the php.ini
extension=wsf.so
3. If you have not enabled php_xsl extension that comes with PHP, then enable it as follows.
extension=xsl.so
If you are using the source distribution, in order to install xsl extension go to ext/xsl directory and do
Set extension_dir entry to point to your extension installation directory.
eg extension_dir="usr/local/lib/php/extensions/debug-zts-***". The last directory depends on your php version.
Uncomment the include_path and edit it to point to the location for scripts folder as
include_path = ".:/path/to/scripts/folder"
4. Also, copy all the samples to your Web server's document root.
5. Test with a Web browser. For example, access http://localhost/echo_client.php
Notes:
To build WSO2 WSF/PHP from source you will need the following dependency libraries.
Libxml2 binary distribution Download
iconv binary distribution Download
OpenSSL binary distribution (Use MSI installer) Download
PHP Source and PHP Binary distributions Download
Win32build [ win32 buildtools for PHP ] Download
sqlite or Mysql Server 5 ( Needed When using Reliable Messaging ) Download sqlite Download MySql
In addition you need to have Microsoft Visual Studio installed on your system.
WSF/PHP extension is build on top of WSF/C Web Services Framework. The extension source code is packaged with WSF/C code. When you download the wso2-wsf-php-src.zip file, it will contain following dirctory structure.
wso2-wsf-php-src | +---src | +--- wsf_c | +--- docs | +--- samples | +--- scripts
In the wso2-wsf-php-src directory you will find a file named configure.in file. Open this file and set your dependency directory locations to relevent entries. You can build with debug symbol by setting DEBUG=1 option. Next run the build.bat file located in wso2-wsf-php-src directory. It should build the binary dist pack to wso2-wsf-php-src directory.
Now follow the installation steps under 2.4 Installing WSO2 WSF/PHP binary to configure the extension.
( Before running the build.bat file, add your vcvars32.bat file location to PATH environment variable. IF you are using vc2005, it is located in C:\Program Files\Microsoft Visual Studio 8\VC\bin )
1. Before trying this, please refer to the README.WIN32-BUILD-SYSTEM file in the PHP source distribution, and build the PHP source under MS Windows.
2. Copy wsf_php folder to php_source/ext directory.
3. Run buildconf.bat file to rebuild the configure.js file.
4. "cscript /nologo configure.js --help" will give the configuration
options. You will find the option --with-wsf.
5. Add the following entries to config.nice.bat file.
"--with-extra-includes=<Libxml2 bin dir>\include;<iconv bin directory>\include;<wsf-c dir>\include"
"-- with-extra-libs=<Libxml2 bin dir>\lib;<iconv bin dir>\lib;<wsf-c dir>\lib"
"--with-wsf=shared"
6. Run the above config.nice.bat file to configure the wsf extension as a dll.
7. "nmake" will build the wsf extension.
1. If you built the extension from the source, you will find the wso2-wsf-php-bin-1.2.0-win32 (binary pack) located in your source directory.
You can get the binary pack by downloading and extracting the binary distribution as well.
It will have the following structure
wso2-wsf-php-bin-1.2.0-win32 | +-- wsf_c | +-- wsf.dll | +-- docs | +-- scripts | +-- samples
2. Copy wsf.dll to the <PHP installation directory>/ext directory.
3. Add wso2-wsf-php-bin-1.2.0-win32\wsf_c\lib directory to the PATH environment variable.
4. Add the above listed dependency library dlls to the PATH environment variable.
5. Add the following entries to your php.ini file which is in your PHP
installation location.
[wsf]
wsf.home="<path_to_extract_folder>\wsf_c"
wsf.log_path="<path to extract_folder>\wsf_c\logs"
wsf.log_level=3
extension=wsf.dll
Set entension_dir entry to your extensions directory.
extension_dir ="./ext"
Also enable php_xsl extension
extension = php_xsl.dll
Uncomment the include_path and edit it to point to the location for scripts folder as
include_path = ".;/path/to/scripts/folder"
6. Configure the Apache2 Web server with PHP as follows.
6.1. Copy php5apache2.dll to Apache2/modules directory and add the following entries in httpd.conf file.
LoadModule php5_module modules/php5apache2.dll
PHPIniDir "< your php.ini file location> "
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
7. Copy the samples folder to your Apache Web server's document root. If you want to run samples
Now you should be able to run the samples in the samples directory.