[postgis-users] Calling shp2pgsql with PHP's exec()

Steffen Macke sdteffen at gmail.com
Mon Jun 18 09:27:44 PDT 2007


Dear Shojka,

> I use Apache 2 with the Windows Server 2003 on Windows XP. I have problem when I call shp2pgsql.exe function through my php script using command exec(), system() etc.. The strangest thig is that when I restart Apache all requests are processed succesfully but only once. What can be the reason for this ?

Good question. Make sure to turn on as much PHP logging as you can get and
check the log files.

Are you running PHP as an Apache module or the cgi version? As Apache
reloading is
changing something, I guess you are running PHP as an Apache module. Try to use
the cgi version in this case.

The DCMMS application was using shp2pgsql successfully through the system
function. You can have a look at the source code to cross-check yours:

https://svn.sourceforge.net/svnroot/dcmms/trunk/dcmms/admin/shapefile_loader.php


Regards,

Steffen



More information about the postgis-users mailing list