Skip to content

List functions disabled in PHP

I’ve got a web client having some really odd problems with a program of mine logging him out randomly. Normally I upload a phpinfo file and use that to see if I could find out anything but when I did that I got an error that phpinfo had been disabled for “security purposes”.

What I really needed was a list of what other functions have been disabled, so I put together the little script below to pull the list of disabled functions, sort them, and then echo them out. Of course if ini_get has been disabled then I might be in trouble and have to actually ask the host for the list.

< ?php
error_reporting(E_ALL);
$disabled_functions = ini_get('disable_functions');
if ($disabled_functions!='')
{
$arr = explode(',', $disabled_functions);
sort($arr);
echo 'Disabled Functions:
';
for ($i=0; $i<count($arr); $i++)
{
echo $i.' - '.$arr[$i].'< br>';
}
}
else
{
echo 'No functions disabled';
}
?>
Published inProgramming

6 Comments

  1. line 9 – you’ve forgot something .
    error_reporting(E_ALL);

    for ($i=0; $i<count($arr); $i++)

    have fun :)

  2. Yup, that should be there. It’s WP stripping out the less than signs…

  3. Wow that was very useful. I just realized we’ve got 28 functions disabled on one of our servers.
    Thanks very much

    • Yikes, that’s way higher than anything I’ve seen.

  4. What if the ‘explode’ function is also disabled?

    • Find a different host.

Leave a Reply

Your email address will not be published. Required fields are marked *