gpt4 book ai didi

Php shell_exec 返回运行进程ID

转载 作者:太空宇宙 更新时间:2023-11-04 11:37:23 28 4
gpt4 key购买 nike


我试图返回一个进程 ID 抛出一个 php.ini 文件。在 Linux 中,此命令返回进程 ID

/receive.sh url=http://www.site.com cert=certs/test_lv.p12?test_lv > /dev/null 2>/dev/null &

我需要运行这个命令抛出一个 php。

$response2 = shell_exec("./receive.sh url=https://www.site.com cert=certs/test.p12?test_lv  > /dev/null 2>/dev/null &");
echo $response2;

它返回一个空字符串。谢谢解答!

已更新*我添加了一个输出 PID,它起作用了!感谢大家!

./receive.sh url=https://www.site.com cert=certs/test_lv.p12?test_lv  > /dev/null 2>/dev/null &  echo $!

最佳答案

我认为你的代码有一个错误,因为它已经在你的命令中将输出重定向到/dev/null ,只需尝试删除输出重定向,它可能会起作用

关于Php shell_exec 返回运行进程ID,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6762261/

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