PHP is having issues executing commands that have -- in it for parameters. I'm running this on Linux.

Please look at the code below:

Code:
//$theCommand = 'myProgram list stuff --parameter1=hello,world,something,else';
//$theCommand = 'myProgram list stuff "column1:name column2:age" --parameter1=hello,world,something,else';
//$theCommand =  'myProgram list stuff sometime';
//$theCommand =  'myProgram list stuff ' . chr(45) . chr(45) . 'parameter1=hello,world,something,else';
//$theCommand = 'myProgram list stuff "column1:name column2:age"';

//$theResult = shell_exec($theCommand);
//exec($theCommand, $theReturn);

echo $theCommand . " <br /><br />";
passthru($theCommand, $theReturn);

print_r ($theReturn);
I was trying various ways to get PHP to execute a command on the CLI.

If I use:
Code:
$theCommand = 'myProgram list stuff --parameter1=hello,world,something,else';
It will return just 1 as the return.

If I then try:
$theCommand = 'myProgram list stuff "column1:name column2:age"';
It will return 0, and some output (Column headers), but it's almost like I didn't specify anything to search for.

If I just run:
Code:
$theCommand =  'myProgram list stuff sometime';
It works fine.

I can run any of these commands in CLI and they all work fine.

I've tried shell_exec(), exec() and passthru().

Any suggestions?