This is my code for executing a command from PHP:
$execQuery = sprintf("/usr/local/bin/binary -mode M \"%s\" %u %s -pathJson \"/home/ec2/fashion/jsonS/\" -pathJson2 \"/home/ec2/fashion/jsonS2/\"", $path, $pieces, $type);
exec($execQuery, $output, $return);
the $return value is always 0 but $output is empty. The $output should be a JSON.
- If I execute the same but removing one letter to
binary(for example/usr/local/bin/binar) I get (correctly) a$return = 127. - If I write other parameters (like
-mode Rwhich doesn't exit) I got errors from the console (which are correct as well). - If I run the exact
$execQuery(which I printf before to be sure about quotation marks) on the console, it executes correctly. It's only the PHP side where I've got the error.
What can be wrong? Thank you in advance.
$outputis an empty array right?