0

I try to run gnome tracker-search from php. For example like this:

<?php
   $result = shell_exec("/usr/bin/tracker-search -l 5 --disable-snippets --disable-color test");
   echo "<pre>$result</pre>";
?>

But the output is empty. When I run /usr/bin/tracker-search --help in php, I get the help output. I also try to put tracker-search in the visudo file, but it have also no effect.

Have anybody an Idea what's happen here?

6
  • print_r($result) or var_dump($result); should help you out. don't use echo , you might be having a array in return. Commented Jun 20, 2016 at 14:35
  • Thank you! But sadly this is not enough. with var_dump($result);I get NULL. Commented Jun 20, 2016 at 14:47
  • then the response is nul Commented Jun 20, 2016 at 14:48
  • as per the docs: ... or NULL if an error occurred or the command produces no output.
    – Marc B
    Commented Jun 20, 2016 at 14:49
  • Yes this I understand, but I don't understand why tracker-search gives no output. When it gets called it always give something back, also when the search result is empty. Commented Jun 20, 2016 at 14:52

0

Browse other questions tagged or ask your own question.