gpt4 book ai didi

php - 从 PHP 脚本 : sh: 1: screen: not found 运行命令

转载 作者:太空宇宙 更新时间:2023-11-04 04:21:17 25 4
gpt4 key购买 nike

我在运行屏幕 session 的脚本时遇到问题。

<?php  exec("screen -m -d ffmpeg2theora -v 3 /path/to/video.mp4");  ?>

并在日志中查看:

Wed Oct 17 16:17:39 2012] [error] [client 83.5.x.x] sh: 1: screen: not found, referer: http://xxxxxx.xx

它停止了一些更新(apache/php/suphp?),在此之前它像魅力一样工作知道发生了什么吗,如何配置 suPhp/Apache?

最佳答案

如果您希望 PHP 在后台启动长时间运行的命令,为什么不尝试以下操作:

<?php pclose(popen("/usr/bin/nohup /path/to/ffmpeg2theora -v 3 /path/to/video.mp4 >/tmp/result 2>&1", "r")); ?>

在这种情况下,使用显式命令路径总是明智的。

关于php - 从 PHP 脚本 : sh: 1: screen: not found 运行命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12937507/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com