shell_exec() could be used instead, but proc_open() has the added benefit of runing commands directly (if passed as array), without forking a shell. Also, shell_exec returns only the command output, and there is no way to capture return codes.
shell_exec() could be used instead, but proc_open() has the added benefit of runing commands directly (if passed as array), without forking a shell. Also, shell_exec returns only the command output, and there is no way to capture return codes.