Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Win XPでPHPを実行しており、プログラムの一部に使用していますが、実行するexec()たびにサーバーでウィンドウが数秒間開かれます。バックグラウンドで実行するにはどうすればよいですか?exec()cmd.exe
exec()
cmd.exe
コマンドの前に を付けstart /Bます。
start /B
$process = popen("start /B ". $cmd, "r");
https://www.php.net/manual/function.exec.php#86329
$WshShell = new COM("WScript.Shell"); $oExec = $WshShell->Run('yourprogpath', 0, false);
Windows のみ。
編集 - WindowsとUnixで機能する場合、Fraxtilの回答の方がおそらく優れていると思います。