Search code examples
phpsuphp

What is the simplest way to check if PHPSUEXEC or SUPHP is enabled, with a php script


I need to check if PHPSUEXEC or SUPHP is enabled. How can I do that within a php script?


Solution

  • The easyiest way to check if its enables is something like this

    ob_start();
    phpinfo();
    $sTmp ob_get_contents();
    ob_end_clean();
    
    $iPos = strripos($sTmp, "PHPSUEXEC"); //not sure how the string in phpinfo is spelled!!
    if($iPos === false) {
     echo "not found";
    } else {
     echo "found";
    }
    

    hope that helps!

    Cheers,

    Dennis