1

How would I execute the following in PHP's shell_exec command?

csvsql --db postgresql://postgres:username@192.168.50.77/mydb --no-constraints --insert --table geocoding_9D91EEDE-0BA5-4622-B4DC-DAE62FD3295F_1 "/tmp/9D91EEDE-0BA5-4622-B4DC-DAE62FD3295F/1/Test.csv"

Executing it directly from the terminal it works 100%, but executing it from php's shell_exec or exec, nothing happens.

Craig Ringer
  • 307,061
  • 76
  • 688
  • 778
Skalla
  • 31
  • 3
  • From the [manual](http://php.net/shell_exec): "This function can return NULL both when an error occurs or the program produces no output. It is not possible to detect execution failures using this function. exec() should be used when access to the program exit code is required." – Mike Jun 01 '15 at 22:29
  • See also: http://stackoverflow.com/questions/2749591/php-exec-check-if-enabled-or-disabled – Mike Jun 01 '15 at 22:30
  • Does the PHP user have permissions to run csvsql? – Andy Hoffner Jun 01 '15 at 22:30

0 Answers0