Personalize

PHP samples dont work

Forums :

Hi,

I have installed the WSF/PHP and seem to have a lot of problems getting it to work.

The latest errors I get is when I run the samples. Each sample program gives me an error, for example the ECHO sample gives me the error:

error creating service in C:\\Program Files\\Apache224\\htdocs\\samples\\echo_service.php

In the apache error log I get:

[error] [client 127.0.0.1] PHP Fatal error:  WSService::__construct() [<a href='function.WSService---construct'>function.WSService---construct</a>]: error creating service in C:\\Program Files\\Apache224\\htdocs\\samples\\echo_service.php on line 39, referer: http://localhost/samples/

I am loosing the will to use the WSF :-(( . Has anybody got this framework working for PHP. BTW, I am currently running it under windows XP env, but plan to port to the Ubuntu 7.0.4.

cheers

tomcat

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Use Apache 2.0

Use Apache 2.0. It seems that WSF/PHP 1.2.1 can't run under Apache 2.2 at present. I did the same mistake and discovered it was not compatible after a few hours.

 

Hi Emanuele

My experience is wsf/php is working with apache 2.2.* version. Right now my apache version is printed as 'Apache/2.3.0-dev', and there it works without problem.

Anyway the problem (service creation failed) can be happen due to configuration problems. Your WSClient is created fine, that mean it is loaded wsf module correctly. But WSService fails because wsf is not loaded by apache. Can you recheck which php.ini file is loaded by apache. And check is that the same one you load the wsf extension. You can use the phpinfo() function to get an idea on this.

 

Thanks

Dimuthu

Dimuthu, Here are some

Dimuthu,

Here are some information from the phpinfo():

______________________________________

Apache Environment



PATHEXT COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH

______________________________________

Configuration File (php.ini) Path     C:\WINDOWS

Loaded Configuration File         D:\php525\php.ini

______________________________________

wsf

wsf support    enabled



Directive    Local Value                  Master Value

wsf.home    C:\PhpTools\wso2-wsf-120-win32\wsf_c      C:\PhpTools\wso2-wsf-120-win32\wsf_c

wsf.log_level    4                      4

wsf.log_path    C:\PhpTools\wso2-wsf-120-win32\wsf_c\logs C:\PhpTools\wso2-wsf-120-win32\wsf_c\logs

wsf.rm_db_dir    /tmp    /tmp

______________________________________

When I ran the echo service and client, this is the error I get in the error.log

[Mon Apr 21 23:44:58 2008] [error] [client 127.0.0.1] PHP Fatal error:  WSService::__construct() [<a href='function.WSService---construct'>function.WSService---construct</a>]: error creating service in C:\\Program Files\\Apache224\\htdocs\\samples\\echo_service.php on line 39, referer: http://localhost/samples/

And on the client page I get this error:

Message = ws client create failed

Having looked at it, it seems that everything is loading and I dont seem to get an error ( I mean I cant see an error that a module has failed loading). Am I missing something?

cheers

tomcat

Change wsf.rm_db_dir to valid windows directory

Hi,

Can you retry setting the wsf.rm_db_dir  to a valid windows directory. This can lead to failure in creating WSClient and WSService

 

Thanks

Dimuthu

Dimuthu,   WIll do , but

Dimuthu,

 

WIll do , but can not find when this needs to be changed. I checked the php.ini file and http.conf and the reference is not in either of them. Do you know where this is?

cheers

Dimuthu OK I added a new

Dimuthu

OK I added a new line and change the directory to

wsf.rm_db_dir="C:\PhpTools\wso2-wsf-120-win32"

and still got the same error. I even tried this

wsf.rm_db_dir="C:\PhpTools\wso2-wsf-120-win32\"

but no joy. I am getting the same error

[Wed Apr 23 11:32:10 2008] [error] [client 127.0.0.1] PHP Fatal error:  WSService::__construct() [<a href='function.WSService---construct'>function.WSService---construct</a>]: error creating service in C:\\Program Files\\Apache224\\htdocs\\samples\\echo_service.php on line 39, referer: http://localhost/samples/

Any ideas what is happening?

cheers

Re: PHP Samples do not work

Hi,

The error you are getting usually happens when the wsf.home directory setting is incorrect. Please verify that the directory you have specified is correct for wsf.home entry. Also make sure that your setting is refering to the correct version of wsf/php. For example if you have copied 1.2.1 wsf.dll to php extensions directory and your wsf.home setting refers to wso2-wsf-php-1.2.0-bin\wsf_c directory it wont work.

Regards

Nandika

Works with WSDL

Hmm...

Nandika, my wsf.home directory settting is correct.

However, just to try something different, I set up the client to use WSDL (I obtained the wsdl file from my .Net client), and it now works.

Thanks for everyone's quick respose.

Steve

Still doesnt work

I am using version 1.2.0 and the home path is the one recommended in the installation:

[wsf]

wsf.home="C:\PhpTools\wso2-wsf-120-win32\wsf_c"

wsf.log_path="C:\PhpTools\wso2-wsf-120-win32\wsf_c\logs"

wsf.rm_db_dir="C:\PhpTools\wso2-wsf-120-win32"

wsf.log_level=4

extension=wsf.dll

extension_dir = "D:\php525\ext"

But it still doesnt work. I wonder if I should move to version 1.2.1?

Cheers

 

Apache error log

Hi,

Can you check the apache error_log. That may tell some information about the issue. And if possible please try with the 1.2.1 release, since it has fixed some problems related to installation.

 

Thanks

Dimuthu

Re: PHP Samples does not work

Hi,

I guess you have added both wso2-wsf-php1.2.1\wsf_c\lib and wso2-wsf-php-1.2.0\wsf_c\lib to your Path environment variable and this should be the reason why the samples are not working.  You may only have one of the above in your path and I recommend 1.2.1 release since it has improvement over the 1.2.0 release.

Regards

Nandika

Problems are still there in version 1.2.1

OK, I installed version 1.2.1, followed the installation instructions and I am still getting problems.

 

I ran both Echo and Math samples and I get the following errors:

For Echo sample:

WSService::reply(wsf.php) [<a href='function.WSService-reply'>function.WSService-reply</a>]: failed to open stream: No such file or directory in C:\\Program Files\\Apache224\\htdocs\\samples\\echo_service.php on line 41, referer: http://localhost/samples/

And for the Math sample:

WSService::reply(wsf.php) [<a href='function.WSService-reply'>function.WSService-reply</a>]: failed to open stream: No such file or directory in C:\\Program Files\\Apache224\\htdocs\\samples\\math_service.php on line 105, referer: http://localhost/samples/

They booth seem to point ot the similar functions:

$service->reply($requestPayloadString);

$svr->reply($reqPayloadString);

which are called after the service is created.

BTW, I first start the service and then run the client.

Any ideas what is happening???

cheers

 

Hi,

Hi,

Its really strange that your error message mensions about wsf.php when you try to run echo client. To call $service->reply() engine doesn't need wsf.php file.

 

BTW, can you check whether you have correctly set the include_path in php.ini file to <WSF/PHP install path>\scripts folder?? If you are getting a problem complaining wsf.php missing, wrong include path might be the problem.

I got something working !!!

Dushshantha

I think you were right. I fixed the "include_path" and things started moving. I ran the Math sample and it worked, however I am not sure what is going on because when I run the first sample i.e.the echo client and server, on the clinet page I get:

Response = <ns1:echoString xmlns:ns1="http://php.axis2.org/samples"><text>Hello World!</text></ns1:echoString>

and on the server pgae, i get



This XML file does not appear to have any style information associated with it. The document tree is shown below.

     

<definitions targetNamespace="http://www.wso2.org/php">

<types> .....

.......

does this mean that the echo client is working?

BTW, I still get a lot of "Undefined variable: PHP_SELF" and "Undefined index" as I run these examples.

I am not really sure when the samples have worked as I dont know what the output is supposed to be!!

cheers

Hi, If you got Response =

Hi,

If you got

Response = <ns1:echoString xmlns:ns1="http://php.axis2.org/samples"><text>Hello World!</text></ns1:echoString>

That mean you have recieved the response message correctly. So i think you got it working.

 

The server page,  were you  trying to acess wsdl by using the postfix "?wsdl". that mean something like "http://localhost/samples/echo_service.php?wsdl". If that so you will have the XML you mention.

And all the warning are also should be to the accessing WSDL.

 

Thanks

Dimuthu

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.