shell_exec 在调用 ConvertHTMLtoImage 时冻结

发布于 2024-12-28 16:50:45 字数 320 浏览 2 评论 0原文

我有一个正在运行的机器人,对我的网站上链接的网站进行预览捕获。我使用一个名为 converthtmltoimage 的程序。抓取大拇指的程序运行在Windows服务器上。我通过 shell_exec 使用命令行选项。然而...converthtmltoimage 在某些网站上有冻结的倾向。导致命令不被执行并冻结我的 PHP 代码。

我可以做什么来解决这个问题?我认为要么在 shell_exec 上启用某种超时,要么使用 Converthtmltoimage 的替代方案......

I have a bot running taking preview captures of sites linked on my site. I use a program called converthtmltoimage for that. The program grabbing the thumbs is running on a windows server. I use the command line option through a shell_exec. However... converthtmltoimage has the tendency to freeze on certain websites. Resulting in the command not being executed and freezing my PHP code as well.

What can I do to resolve this? Either enabling some sort of timeout on the shell_exec or an alternative to converthtmltoimage I would assume...

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

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

发布评论

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

评论(1

俏︾媚 2025-01-04 16:50:45

试试这个:

  $WshShell = new COM("WScript.Shell"); 
  $oExec = $WshShell->Run("<add program and parameters here>", 7, false);

请注意,仅适用于 Windows!

Try this:

  $WshShell = new COM("WScript.Shell"); 
  $oExec = $WshShell->Run("<add program and parameters here>", 7, false);

Mind you, only works on Windows!

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