Asynchronous shell exec in PHP

前端 未结 13 2167

I\'ve got a PHP script that needs to invoke a shell script but doesn\'t care at all about the output. The shell script makes a number of SOAP calls and is slow to complete,

13条回答
  •  孤城傲影
    2020-11-22 01:13

    without use queue, you can use the proc_open() like this:

        $descriptorspec = array(
            0 => array("pipe", "r"),
            1 => array("pipe", "w"),
            2 => array("pipe", "w")    //here curaengine log all the info into stderror
        );
        $command = 'ping stackoverflow.com';
        $process = proc_open($command, $descriptorspec, $pipes);
    

提交回复
热议问题