diff --git a/php-loop.pl b/php-loop.pl index cc0c110..94c8e74 100755 --- a/php-loop.pl +++ b/php-loop.pl @@ -7,11 +7,6 @@ our $dead = 0; our $childpid = 0; -if (!-x $ARGV[0]) { - print STDERR "PHP command $ARGV[0] does not exist!\n"; - exit(2); - } - $SIG{'TERM'} = sub { $dead = 1; if ($childpid) { @@ -23,6 +18,10 @@ }; while(!$dead) { + if (!-x $ARGV[0]) { + print STDERR "PHP command $ARGV[0] does not exist!\n"; + exit(2); + } my $start = time(); $childpid = fork(); if ($childpid == 0) {