我尝试在后台执行php中的.bat文件(带有xampp的Windows Server)。当我点击按钮后,它也应该去另一个网站。 但是当我点击按钮时,浏览器正在等待脚本完成。大多数情况下,这是以超时结束。从后台执行.bat文件
我的PHP代码:
if (isset($_POST['test']))
{
exec('C:\Daten\test.bat');
header("Location:test_status.php");
}
我怎么能告诉PHP EXEC,以不等待?
我也试过以下,但不工作:
exec('C:\Daten\test.bat' . '> /dev/null &');
你试过'pclose函数(POPEN( “开始/ B”。$ CMD, “R”) );'[from here](http://php.net/manual/en/function.exec.php#86329)其中'$ cmd'是你想运行的命令。 – MoshMage
这可以帮助http://stackoverflow.com/questions/649634/how-do-i-run-a-bat-file-in-the-back-from-another-bat-file –
相关,[你怎么样从PHP运行一个.bat文件?](http://stackoverflow.com/q/835941) – jww