Click here to Skip to main content
15,912,756 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am getting this error on this code:

PHP
$folder = $_SERVER['DOCUMENT_ROOT'].'/projects/charli/dashboard/';
$folder = escapeshellcmd($folder);

if( ! is_dir($folder) )
{
        echo "$folder is not a folder.<br />";
}
else
{
        $output = `du -s $folder`;

        if( preg_match('/([0-9]+)(\t.*)/',$output,$match) )
        {
                $size = $match[1];

                echo "Folder $folder is $size bytes<br />";
        }
        else
        {
                echo "Error fetching folder size, are you on Linux? and can you execute commands?<br />";
        }
}


error:
Warning: shell_exec() has been disabled for security reasons
anyone?
Posted
Updated 11-May-14 23:52pm
v2
Comments
CHill60 12-May-14 8:18am    
It means that whoever is responsible for wherever you are running this code has decided that shell_exec is unsafe. Although you are not explicitly calling shell_exec in your code, you are using it with the escapeshellcmd call

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900