I am using this post's answer, but I want to get one file for stderr and one file for stdout.
This is what I currently have:
exec(sprintf("%s > %s 2>&1 & echo $! >> %s", $cmd, $outputfile, $pidfile));
I am using this post's answer, but I want to get one file for stderr and one file for stdout.
This is what I currently have:
exec(sprintf("%s > %s 2>&1 & echo $! >> %s", $cmd, $outputfile, $pidfile));
Please ask a proper question, since I don't really know what you mean. I'm going to assume you want to separate the output and error file?
If you want separate files for stdout and stderr, you need to remove the redirection 2>&1
(which redirects stderr to stdout).
exec(sprintf("%s > %s 2>%s & echo $! >> %s", $cmd, $outputfile, $errorfile, $pidfile));