Using PHP's system/exec commands to run a script that in-turn makes an executable run, that executable when run directly via terminal generates 2 text files successfully but fails to do so when it is made to run using command in php, which is:
system("bash run.sh");
this run.sh contains command which executes an executable. contents of run.sh are:
#!/bin/bash
./op 2
where op
is an executable file, which successfully creates two text files only when run using a terminal.