このファイルを引数として PHP インタープリターを使用proc_open
および呼び出すことができます。これはデータをメモリに保存しませんが、別のプロセスを作成します。
$descriptorspec = array(
0 => array("pipe", "r"), // stdin is a pipe that the child will read from
1 => array("file", $path, "w"), // stdout is a pipe that the child will write to
2 => array("file", $path, "a") // stderr is a file to write to
);
$process = proc_open('php dynamic_data.php', $descriptorspec, $pipes);
if (is_resource($process)) {
// $pipes now looks like this:
// 0 => writeable handle connected to child stdin
// 1 => readable handle connected to child stdout
// Any error output will be appended to /tmp/error-output.txt
fclose($pipes[0]);
fclose($pipes[1]);
$return_value = proc_close($process);
}
?>