PHP exec - check if enabled or disabled

Adrian M. picture Adrian M. · May 1, 2010 · Viewed 60.4k times · Source

Is there a way to check in a php script if exec() is enabled or disabled on a server?

Answer

Michael D Price picture Michael D Price · Jan 14, 2013

This will check if the function actually works (permissions, rights, etc):

if(exec('echo EXEC') == 'EXEC'){
    echo 'exec works';
}