I have the following issue when I try to pass a shapefile to PostGIS. When I run this part of code through the terminal:
shp2pgsql -s 2100 -d /var/www/dkar/MarCO/Code/python/output/cluster/clusterNodes_.shp | psql -h localhost -p **** -d ****** -U *******
It works perfectly and a new table in PostGIS is created, but when I try to do the same through a PHP script which I execute on a submit button then I get an error. I can not say for sure what's the error why I run the whole process through PHP exec so I just get an error code 2.
Also when I do the process through the terminal, I am asked for entering the db password. I also tried to include the password in the command like:
`... -W password`
but it didn't make any difference.
The whole thing runs smoothly locally but it doesn't work in the remote server.
Any ideas what I might miss here?
Perhaps the path to the shapefile should be different in each case?