douna2014 2019-04-27 16:12
浏览 75

为什么现场控制台输出不起作用? (PHP)

I am sending some data to php through ajax and I am running a jar file with cmd. I want the live output from the console command.

I am trying my code and in console.log() it only outputs blank;

chdir("C:/Users/Dan/Desktop");
    ob_end_flush();
ini_set("output_buffering", "0");
ob_implicit_flush(true);
$cmd = "java -jar auto.jar";
 $proc = popen($cmd, 'r');
    while (!feof($proc))
    {
        echo fread($proc, 4096);
    }
  • 写回答

0条回答 默认 最新

    报告相同问题?