[postgis-users] Calling shp2pgsql with PHP's exec()
Steffen Macke
sdteffen at gmail.com
Wed Jun 20 07:39:21 PDT 2007
Hi,
> My php-error log file does not get any error but what is puzzling that in my
> apacher error.log file I get as an error exactly what should be expected answer on the
> console window if I had used commando line.
shp2pgsql is writing it's progress output to stderr, because the generated
And the default PHP configuration is writing this output to Apache's error.log
Please have a look at
https://svn.sourceforge.net/svnroot/dcmms/trunk/dcmms/admin/shapefile_loader.php
It shows you how to redirect the shp2pgsql progress and error
information to a file using "2>" and the PHP system() function.
It also shows you how to check the shp2pgsql return value, which is important
to determine if everything went ok.
Regards,
Steffen