I wasn't sure if there were a native-born process to determine if you have shell access using PHP, so I wrote my own, but not sure if I've covered everything, please review:
if (!function_exists('is_shell_executable')) {
/**
* Determine if the shell command is executable. Uses {@link http://us3.php.net/manual/en/features.safe-mode.php#ini.safe-mode-exec-dir "safe_mode_exec_dir"} system-defined variable
*
* @access public
* @param mixed $kommand Shell command
* @return boolean
* @see in_array_partial
*/
function &is_shell_executable($kommand) {
if (!$kommand) trigger_error('Command not provided', E_USER_WARNING);
// CHECK TO SEE IF $kommand IS WITHIN THE safe_mode_exec_dir
if (@ini_get('safe_mode') && @!in_array_partial($kommand, preg_split('/[;\n\r\s\t]+/i', ini_get('safe_mode_exec_dir')))) return false;
if (preg_match('/Access[\s\t]+denied|Permission[\s\t]+denied|[^a-zA-Z0-9\-_\.]+err[or]*/i', shell_exec(escapeshellcmd($kommand)))) return false;
return true;
}
}
Thanx
Phil