[postgis-users] pgsql2shp/shp2pgsql and php

strk strk at keybit.net
Fri Apr 2 01:47:42 PST 2004


On Thu, Apr 01, 2004 at 05:50:37PM +0200, Stefan Donath wrote:
> thanks david!
> 
> i tried this:
> 
> <?php
> $ret = shell_exec ("pgsql2shp -f <filename> -u <user> -g <geom_column> -h
> <host> <dbname> <tablename> 2>&1");
> echo $ret;
> ?>
> 
> and received the error message: could not create dbf file

The user the httpd server is running as does probably not have
permissions to write in the directory your script is in.
--strk;

> 
> when running pgsql2shp from command line everything works fine but not from
> within the php-script! i also tried the .sh-thing but the same result! any
> ideas???
> 
> stefan
> 
> 
> 
> 
> 
> you should use from php
> shell_exec("shp2pgsql ...");
> or 
> shell_exec(pgsql2shp ..."),
> or writing a shell (foo.sh) from php-script with in
> foo.sh:
> shp2pgsql ....
> pgsql2shp ...
> and do shell_exec(foo.sh)
> I think this method could be improved :)
> 
> -- 
> +++ NEU bei GMX und erstmalig in Deutschland: TÜV-geprüfter Virenschutz +++
> 100% Virenerkennung nach Wildlist. Infos: http://www.gmx.net/virenschutz
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users



More information about the postgis-users mailing list