Showing posts with label installation. Show all posts
Showing posts with label installation. Show all posts
How to install WSF/PHP in Debian/Ubuntuu Systems from scratch
Monday, October 20, 2008
In the post WSF/PHP from the scratch Dinesh explains how to install WSF/PHP in a Debian or Ubuntu System from the scratch. He starts the post with a how to on installing and configuring Apache and PHP in a fresh debian machine and then install WSF/PHP on top of them. If you are finding help to install WSF/PHP on a debian machine, this post will be really useful.
Installing wsf/php in a third party hosting environment
Wednesday, August 6, 2008
If you have a third party hosting environment and you want to use wsf/php extension, you have to set to deploy the PHP as cgi-based and not through traditional mod_php. That way you will be able to use custom php.ini and configure wsf/php installation. Make sure to check whether your hosting service have capability to deploy cgi-based php and any documentation for that. For an example dreamhost provides following documentation for that. http://wiki.dreamhost.com/Custom_PHP.ini
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.
For an example if you put the above code to the echo client in sample directory it would be like,
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());
}
}
?>
Labels:
dreamhost,
installation,
php.ini,
relative dir,
third party hosting,
wsf.home,
WSF/PHP
Subscribe to:
Posts (Atom)