//Windowsの場合はpopen関数で非同期実行
if (strpos(PHP_OS, 'WIN')!==false) {
//「start」コマンドで非同期実行
$fp = popen('start php test.php', 'r');
pclose($fp);
//Linuxの場合はexec関数で非同期実行
} else {
//「>」で出力先指定(*出力先はnullなので出力しない)
//「&」で非同期実行
exec('php test.php > /dev/null &');
}
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme