How to list disabled functions in PHP
I have a web client that had some really odd problems with a program of mine randomly logging him out. 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 had been disabled, so I put together the short 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
-
if ($disabled_functions!=”)
-
{
-
echo ‘Disabled functions:<br>’;
-
for ($i=0; $i<count($arr); $i++)
-
{
-
}
-
}
-
else
-
{
-
echo ‘No functions disabled‘;
-
}
-
?>
There is another, shorter, version but it doesn’t sort the list and the output is from a print_r command.
Either of these should give you the correct information, although the first is friendlier to look at.
Question, Comments...
Do you have more questions. Please either leave a comment below or join us in our new forum.