我在我的php腳本中運行一個linux命令shell_exec()
。php-如何在執行命令時從linux終端獲取shell_exec()輸出?
$output = shell_exec('/usr/bin/linux-command ');
After
執行命令我正在把值變成一個變量。沒關係。
但是,這裏我的linux命令會給出輸出continuously in terminal
。
它會像這樣..
$linux-command
123 456 789
789 456 123
123 456 789 .. //and so on..(by pressing 'Ctrl+c' only we can stop this.
對於每5秒,將顯示一條線。如何每5秒檢索一次該行。
我的頁面正在被加載........因爲它正在等待$output
。
有什麼辦法可以解決我的問題嗎?
任何想法表示讚賞。謝謝你在前進
見http://stackoverflow.com/questions/9791875/how-to-run-shell-script-with-live-feedback-from-php – devnull