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
In order 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/samples/echo_client.php
Notes:
To build WSO2 WSF/PHP from source you will need the following dependency libraries.
OpenSSL binary distribution (Use MSI installer)
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 directory 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 relevant 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. If you built the extension from the source, you will find the wso2-wsf-php-bin-x.y.z-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-z.y.z-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-x.y.z-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.
Set entension_dir entry to your extensions directory.
extension_dir ="./ext"
Enable wsf extension.
extension=wsf.dll
Set WSF/PHP configuration options.
[wsf]
wsf.home="<path_to_extract_folder>\wsf_c"
wsf.log_path="<path to extract_folder>\wsf_c\logs"
wsf.log_level=3
wsf.rm_db_dir="<path to extract_folder">\wsf_c"
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.
Note:- We ship windows binary with SSL enabled by default. Therefore, you would need to have ssl configured in apache as well.