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

Leave a Reply

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