[GRASSLIST:4545] Re: grass cmd from php???

Glynn Clements glynn.clements at virgin.net
Thu Oct 14 20:41:22 EDT 2004


Massimiliano Cannata wrote:

> Just as a curisity, for a possible future mapserver application....
> It is possible to execute a grass command from php?
> If yes, how to pass the command? (it should open a grass session with 
> all the var needed i guess!)

Essentially, you need to set the appropriate environment variables
then run the program. See $GISBASE/etc/Init.sh for a full list of the
environment variables which are set for a normal interactive session,
but the important ones are GISBASE and GISRC.

For a server, you will need to either dynamically create a mapset for
each "session", or manage a pool of mapsets. The key point is that you
can't safely run multiple commands simultaneously in a single mapset.

-- 
Glynn Clements <glynn.clements at virgin.net>




More information about the grass-user mailing list