Problem with PHP MapScript Wrappers for WxS Services

Frank Warmerdam warmerdam at POBOX.COM
Tue Nov 28 11:55:37 EST 2006


Frank Warmerdam wrote:
> Ben Tuttle wrote:
>> PHP Script:
>>
>> <?php
>> dl("php_mapscript.so");
>> $request = ms_newowsrequestobj();
>> print "<br><b>Dump of request: </b>";
>> var_dump($request);
> ...
>> /*
>> $request->loadparams();
> 
> 
> Ben,
> 
> Is there a reason that loadparams() is commented out?  This is the call
> that parses the QUERY_STRING into parameters on the request object.
> 
> Or perhaps I'm missing what you are trying to do?

Folks,

In follow up on this I have come to a momentus discovery.  Not all web
application are cgi based!

Yes, it's hard to imagine, but it's true.

Not entirely surprisingly when using mod_php (and presumably all the other
non cgi environments) the cgi environment variables do not get set.  And
worse, the loadParams() which expects to be used in a cgi enviroment just
calls exit() after any failure, taking down the whole web server
instance (or at least the thread for that request) without returning anything
useful.

It seems that in non-cgi environments folks wanting to use the WxS services
will need to parse the request using mechanisms other than loadParams(), and
populate the keyword/value pairs in the OWSRequest object manually.

I have updated the WxS services howto with a note about this, and also will
keep the bug report open as a place to consider ways of passing in the url
to loadParams() for 5.0.

   http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=1975

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org



More information about the mapserver-users mailing list