MyBB Community Forums

Full Version: shell exec error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i have this error

Warning: shell_exec() [function.shell-exec]: Cannot execute using backquotes in Safe Mode in (*mypath)/foro/inc/functions.php on line 1204

can someone help me?
I think the easiest way would be to open inc/functions.php and find:
function get_server_load()
{
	global $lang;
	if(strtolower(substr(PHP_OS, 0, 3)) === 'win')
	{
		return $lang->unknown;
	}
	elseif(@file_exists("/proc/loadavg") && $load = @file_get_contents("/proc/loadavg"))
	{
		$serverload = explode(" ", $load);
		$serverload[0] = round($serverload[0], 4);
		if(!$serverload)
		{
			$load = @exec("uptime");
			$load = split("load averages?: ", $load);
			$serverload = explode(",", $load[1]);
		}
	}
	else
	{
		$load = @exec("uptime");
		$load = split("load averages?: ", $load);
		$serverload = explode(",", $load[1]);
	}
	$returnload = trim($serverload[0]);
	if(!$returnload)
	{
		$returnload = $lang->unknown;
	}
	return $returnload;
}
(note the middle part might not be exactly the same)

And replace it with:
function get_server_load()
{
	global $lang;
	return $lang->unknown;
}
Evil Chicken Wrote:But how do I input the code? Where in Cybercuck do I do it?

Stomp Wrote:i have this error

Warning: shell_exec() [function.shell-exec]: Cannot execute using backquotes in Safe Mode in (*mypath)/foro/inc/functions.php on line 1204

can someone help me?

Download a fresh copy of MyBB from the site and replace inc/functions.php with the copy from the site.

This functionality was changed and the error shouldn't appear.