#PHP
PHP
I'm suprised that it actually works, but closing STDOUT
and STDERR
suppresses all output. To be sure that they will not be opened again, we open /dev/null
three times to reassign the file descriptors 0, 1 and 2:
<?php
fclose(STDIN);
fclose(STDOUT);
fclose(STDERR);
fopen('/dev/null','r');
fopen('/dev/null','w');
fopen('/dev/null','w');
// insert program here
More on that: https://stackoverflow.com/questions/937627/how-to-redirect-stdout-to-a-file-in-php