- fildes_fdopen
- fildes_close
- fildes_fileno
- fildes_dup
- fildes_dup2
<?php
$stdout = fopen("out.log", "a");
$tmp_fd = fildes_fileno($stdout);
if(fildes_dup2($tmp_fd, fildes_fileno(STDOUT))<0){
fwrite(STDERR, "dup2 failed");
exit;
}
fildes_close($tmp_fd);
echo "Hello world!"; // this goes to out.log
phpize;
./configure;
make;
make install;