<?php
  header("Content-type: text/plain");

  // display errors
  error_reporting(E_ALL | E_STRICT);  // display all errors
  ini_set('display_errors', '1');
  ini_set('display_startup_errors', '1');
  ini_set('html_errors', '0');      // don't output html links in error messages

  // show gateway
  print "GATEWAY_INTERFACE: " . $_SERVER['GATEWAY_INTERFACE'] . "\n";
  echo str_repeat('-', 80) . "\n";

  // run test commands
  $testCommands = array();
  $testCommands[] = 'sh -c "ulimit -a -S"';
  $testCommands[] = 'sh -c "ulimit -a -S" 2>&1';  // redirect errors
  $testCommands[] = 'ver2';
  $testCommands[] = 'ver2 2>&1';  // redirect errors
  $testCommands[] = 'ver';

  foreach ($testCommands as $command) {
    $output = shell_exec($command);
    echo "Output from: $command\n$output\n\n";
    echo str_repeat('-', 80) . "\n";
  }

  echo "done!";
?>
