Posted by & filed under Programming.

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

6 Responses to “List functions disabled in PHP”

  1. saw13

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

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

    have fun :)

    Reply

Leave a Reply

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