尝试在 PHP 中启动外部程序 (.hta) 文件

发布于 2024-12-18 07:16:07 字数 559 浏览 3 评论 0原文

对于一个学校项目,我编写了一个网络应用程序来拍照(使用相机)并对其进行一些分析。我下载了一个名为 DIYPhotoBits (capture.hta) 的工具,它可以远程触发相机快门,我正在尝试用 php 启动它。问题是,以下命令都不起作用。服务器就像在等待一样挂起。错误日志没有显示任何内容。如果我在 Windows 资源管理器中输入下面的路径,程序就可以正常运行。

有谁知道为什么?太感谢了。

popen('C:/Users/Nick/Documents/Webpages/microplate/executables/capture.hta', 'r');
exec('C:/Users/Nick/Documents/Webpages/microplate/executables/capture.hta');
system('C:/Users/Nick/Documents/Webpages/microplate/executables/capture.hta');
passthru('C:/Users/Nick/Documents/Webpages/microplate/executables/capture.hta');

For a school project, I've written a webapp to take a picture (using a camera) and do some analysis on it. There is a tool I downloaded called DIYPhotoBits (capture.hta) which remotely fires the camera shutter, and I am trying to start it with php. The problem is, NONE of the below commands work. The server just hangs like it's waiting. Error logs reveal nothing. If I enter the path that is below into Windows Explorer, the program runs just fine.

Does anyone know why? Thank you so much.

popen('C:/Users/Nick/Documents/Webpages/microplate/executables/capture.hta', 'r');
exec('C:/Users/Nick/Documents/Webpages/microplate/executables/capture.hta');
system('C:/Users/Nick/Documents/Webpages/microplate/executables/capture.hta');
passthru('C:/Users/Nick/Documents/Webpages/microplate/executables/capture.hta');

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

长发绾君心 2024-12-25 07:16:07

请原谅我是一个批处理新手,但是您是否尝试过通过在路径之前添加“start”命令来启动程序?我一直在尝试使用您给 PHP 的命令启动一个可执行文件,但没有成功。

另外,您的 .hta 扩展名是否分配了一个程序来打开它......?

Forgive me for being a batch newbie, but have you tried starting the program by prefixing the 'start' command before the path? I've been trying to start an executable file with the command you've given to PHP, unsuccessfully.

Also is your .hta extension assigned a program to open it with..?

忘东忘西忘不掉你 2024-12-25 07:16:07

尝试使用 shell_exec() 函数或反引号运算符 (``)

Try the shell_exec() function or the backtick operators (``)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文