Skip to main content
Commonmark migration
Source Link

#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

#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

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

replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

#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: http://stackoverflow.com/questions/937627/how-to-redirect-stdout-to-a-file-in-phphttps://stackoverflow.com/questions/937627/how-to-redirect-stdout-to-a-file-in-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: http://stackoverflow.com/questions/937627/how-to-redirect-stdout-to-a-file-in-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

Source Link

#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: http://stackoverflow.com/questions/937627/how-to-redirect-stdout-to-a-file-in-php