が発生した場合、PHPでコマンドを継続するためにどのようにエラーが、私はPHPでいくつかのコマンドを実行する最初のコマンドで
//DISPLAY setting
$command1 = 'export DISPLAY=:1';
$last_line1 = system($command , $rtn);
//use Xvfb
$command2 = 'Xvfb :1 -screen 0 '.$width.'x'.$height.'x24 &';
$last_line2 = system($command , $rtn);
//open firefox
$command3 = 'firefox -display :1 -width '.$width.' -height '.$height.' -P "webshot" &';
$last_line3 = system($command , $rtn);
//open URL
$command4 = 'firefox -display :1 -remote "openurl('http://www.google.com')" &';
$last_line4 = system($command , $rtn);
COMMAND3は多少の誤差が発生しますが、彼らは無視することができます。 私はcommand4を実行し続けたいが、command3はいくつかのエラーが発生するので実行できない。
この問題を解決するにはどうすればよいですか?それは良いプログラミングの練習じゃないけど
http://php.net/manual/en/language.exceptions.php –
代わりに 'popen'や' proc_open'を使うようにしてください – Lake
どのようなエラーですか?続行する必要があります。失敗した 'system'呼び出しは、通常は実行を終了しません。 – deceze