There may be some hosting environments (Here I mean hosting services deployed php in linux based systems) that you are not have permission to read root directories. So in such cases you have to set the extension_dir entry in the php.ini relative to the cgi-bin directory in your document root. But wsf/php 1.3.2 and lower versions having a problem of not loading wsf.home directory when you are using WSClient class. But it works well for WSService by default.
You can solve this problem by putting the following code right before you use WSClient.
$script_dir = dirname($_SERVER['PHP_SELF']);
$htdocs_dir = '.'.preg_replace('/[^\\/']+/, '..', $script_dir);
$cgibin_dir = $htdocs_dir.'/cgi-bin';
chdir($cgibin_dir);
For an example if you put the above code to the echo client in sample directory it would be like,
$requestPayloadString = <<<XML
<ns1:echoString xmlns:ns1=http://php.axis2.org/samples><text>Hello World!</text></ns1:echoString>
XML;
try {
$script_dir = dirname($_SERVER["PHP_SELF"]);
$htdocs_dir = ".".preg_replace("/[^\\/"]+/, "..", $script_dir);
$cgibin_dir = $htdocs_dir."/cgi-bin";
chdir($cgibin_dir);
$client = new WSClient(array( to => "http://test.dimuthu.org/samples/echo_service.php" ));
$responseMessage = $client->request( $requestPayloadString );
printf(Response = "%s <br>", htmlspecialchars($responseMessage->str));
} catch (Exception $e) {
if ($e instanceof WSFault) {
printf(Soap Fault: "%s\\n", $e->Reason);
} else {
printf(Message = "%s\\n",$e->getMessage());
}
}
?>