At the moment I write my xml data into a file and I pass the file path as parameter to the c++ program
$json = exec("/home/otf/a.out ".$file_path, $out);
This is working fine.
But instead of writing the xml into a file than pass it to the c++ program
I want to pipe directly the xml to the c++ program
$cmd = "echo '".$xml."' | /home/otf/a.out";
$json = exec($cmd);
this is not working
but If I log the command $cmd and I execute it directly via the command line its working
Note : the xml is ~400kB
We are planning to call this program ~6millions time a day and I am a little scared of this answer : https://stackoverflow.com/a/10113714/2942945
EDIT :
If I run this command :
getconf ARG_MAX
I see the limit of the command line is 2097152 so, is there a limit to exec() ?