note 12685 deleted from function.system by jimw
| From: | jimw@php.net | Date: | Sat, 08 Dec 2001 23:56:27 +0000 |
| Subject: | note 12685 deleted from function.system by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-22394@lists.php.net to get a copy of this message | ||
I had a problem where for some reason, PHP would wait for the child program to end... I was using
this to execute it:
system("/blah/etc/foobar.pl < /dev/null 2>&1 > /dev/null");
and it still still would wait for the program to return... so i put this at the begining of
foobar.pl... which closes all the normal stdin/stdout/stderr file handlers... then re-executes the
program...
#!/usr/local/bin/perl
use POSIX;
close STDOUT;
close STDERR;
close STDIN;
fork() && exit 0;
.. put your perl code here.