Well, there are only two ways to disable it: safe_mode or disable_functions .
So you can check, for example:
function isAvailable($func) { if (ini_get('safe_mode')) return false; $disabled = ini_get('disable_functions'); if ($disabled) { $disabled = explode(',', $disabled); $disabled = array_map('trim', $disabled); return !in_array($func, $disabled); } return true; }
Oh and function_exists should return true, since this is the main function (otherwise you could create the main function and cause some real chaos on the host). Therefore, is_callable should also return true (since the function exists). So the only ways to say this is to check ini settings or actually call it ...
Edit: Another note: there are several ways to execute shell commands. Departure:
source share