Hub*_*bro 6 php windows xampp 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"]);
Run Code Online (Sandbox Code Playgroud)
知道这个错误意味着什么,是什么原因引起的?
Ste*_*n B 10
它不是0 => array("pipe" => "r"),但0 => array("pipe", "r")^^
此外,在提供文件名时,您需要指定要使用的模式.这适用于我的机器:
$descriptorspec = array(
0 => array("pipe", "r"),
1 => array("pipe", "w"),
2 => array("file", "logs/errors.txt", "a") );
// Create child and start process
$child = array("process" => null, "pipes" => null);
$child["process"] = proc_open("notepad.exe > nul 2>&1", $descriptorspec, $child["pipes"]);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2453 次 |
| 最近记录: |