shell_exec()
を使用して職人のコマンドをエミュレートしようとしました。しかし、何とか起動すると、端末はブロックされます。Laravel Artisanはターミナルをブロックせずに組み込みサーバーをどのように提供しますか?
shell_exec("php -S localhost:8000 &"); // runs the server but blocks the terminal
$result = shell_exec("php -S localhost:8000 &> /dev/null 2>&1"); echo $result; // this does not show anything
PHPサーバーが起動したら、私はカスタムメッセージを作成できるようにアイデアがある:私はまた、バックグラウンドでそれを実行して出力を変数に格納してみました。