PHP proc_open 不起作用 - 给我“数组中缺少句柄限定符”
警告:proc_open():第 102 行 C:\...\updatedots.php 中的数组中缺少句柄限定符
我试图打开记事本并在 2 秒后将其关闭。这是我的代码:
$descriptorspec = array(
0 => array("pipe" => "r"),
1 => array("pipe" => "w"),
2 => array("file" => "logs/errors.txt")
);
// Create child and start process
$child = array("process" => null, "pipes" => array());
$child["process"] = proc_open("notepad.exe > nul 2>&1", $descriptorspec, $child["pipes"]);
知道这个错误意味着什么以及导致它的原因吗?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它不是
0 =>; array("pipe" => "r")
但0 => array("pipe", "r")
^^此外,在给出文件名时,您需要指定要使用的模式。这适用于我的机器:
It is not
0 => array("pipe" => "r")
but0 => array("pipe", "r")
^^Additionally, when giving a filename you need to specify the mode to use. This works on my machine: