Check if "exec" is disabled

exec, php

Solution

<?php
function exec_enabled() {
  $disabled = explode(',', ini_get('disable_functions'));
  return !in_array('exec', $disabled);
}
?>

EDIT: Fixed the explode as per Ziagl's comment.

Problem

Is there any function in PHP that I can use to detect whether or not the `exec` function is available?

Original source

Related problems