I believe the rest of the line should discard any response, so php script may keep working
If you do not understand this, here is an explanation. If you have:
exec($this->path.' start > /dev/null 2>&1 &');
The part > /dev/nullmeans redirecting stdout (i.e. regular output generated by the command) to / dev / null (which is a null device). Therefore, any output created by the team itself will be suppressed.
Part 2>&1means stderror redirection (i.e. any errors that occur when executing the command) to stdout. However, since stdout is redirected to / dev / null, any errors will also be redirected there. Therefore, with these two, it suppresses any messages that will ever be created by the team.
, & () . Bash man:
&, . , 0 (true).
, , , , . - , . PHP - , , PHP exec. , , . - . PHP, set -m ( ). : set -m set +m. PHP:
exec('set -m && ' . $this->path.' start > /dev/null 2>&1 &');
, , - PHP script, jobs . , PHP . - :
[1]+ Stopped your_command.sh
, stopped. , stopped, .
, , - , checkjobs. , :
shopt -p | grep checkjobs
shopt -u checkjobs, . shopt -s checkjobs, , , , , , , . , , PHP . shopt -u checkjobs && PHP.
exec('shopt -u checkjobs && ' . $this->path.' start > /dev/null 2>&1 &');