我尝试在1&1 Linux共享Web服务器(debian GNU / Linux 8发行版)上使用shell_exec()函数执行.php脚本 .

private function callAsyncSkript(){
    // Asynchron Zipping over executing a Script in a new process.
    if (substr(php_uname(), 0, 7) == "Windows"){
        $cmd = "start /B php .\src\Core\Services\AsynchronZip.php fileids=".$this->idQuerry . " fulllink=".$this->uri;
        pclose(popen($cmd, "r"));
    }
    else {

        $cmd = "/usr/bin/php7.2-cli ".getcwd()."/src/Core/Services/AsynchronZip.php fileids=".$this->idQuerry . " fulllink=".$this->uri;
        shell_exec("/usr/bin/nohup ".$cmd." >/dev/null 2>&1 &"." | at now");
        //shell_exec("/usr/bin/nohup ".$cmd." >/dev/null 2>&1 &");
    }
}

“/ usr / bin / nohup”添加无助于异步执行脚本,如果使用“| at now”脚本将不会执行 . 我是否需要设置一些特殊设置,或者是否有其他选项可以通过命令行进行异步执行?

我发现我可用的唯一shell是rssh . 有可能她是错的 .