Tell me more ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a geotiff Rasterimage and I want to import it to PostGIS via php. I'm using windows server 2008 with ms4w 3.0.6 installed.

My php code looks like this:

include ("db.php"); $rasterpath="C:\\Programme\\PostgreSQL\\9.2\\bin"; shell_exec("$rasterpath\\raster2pgsql -s 4326 -C -M –a C:\\foo.tiff -F public.rasterfoo | psql –d database –h localhost –p 5432 –U postgres");

When I'm running this code nothing happens and the browser loads till the max_execution_time is exceeded without writing any errors to the Apache error log.

When I change the vertical bar | into a broken vertical bar ¦ like in the windows command prompt, an entry in the error log appears which says: "ERROR: Unable to read raster file: \x96a\r"

I've really tried a lot of things (full permission on folders, using simple slashes, system(), exec(), forward slashes, backslashes, simple and double slashes...), but I can't get it running. When I use the windows command prompt everything works fine and the raster gets imported to the database.

I'm trying this for days now and I would appreciate any help.

Many thanks in advance

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.