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';
}
?>

This entry was posted in Programming. Bookmark the permalink.

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

4 Responses to List functions disabled in PHP

  1. saw13 says:

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

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

    have fun :)

  2. Ryan says:

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

  3. PrideZ Host says:

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