我使用 php 运行外部 exe 文件:
<?php
$command = '"F:\\An Software\\abc.exe"';
exec($command);
?>
abc.exe
是一个接口文件,没有命令行输出。
我检查任务管理器并看到 abc.exe 已经在运行,但我看不到它的窗口。并且浏览器无法完成它的请求。
我认为这个问题在这个关于 exec 函数的php.net 文档中是可描述的:
If a program is started with this function, in order for it to continue running
in the background, the output of the program must be redirected to a file or
another output stream. Failing to do so will cause PHP to hang until the
execution of the program ends.
但我不知道如何解决它。你能告诉我一个解决方案吗?谢谢!