MyBB Community Forums

Full Version: SecureSSI error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
A german free host upgraded from PHP4 to PHP5 and now all users get the following error:
Quote:SecureSSI: Das Script (/usr/export/www/hosting/xyz/MyBB/index.php) hat versucht, ausserhalb von seinem Userverzeichniss, auf die Datei /proc/loadavg zuzugreifen.
Aus Sicherheitsgruenden ist dies nicht erlaubt!
In english: The script located at /usr/export/www/hosting/xyz/MyBB/index.php tried to access the file /proc/loadavg outside of the user's directory. This is not allowed because of security reasons.
In functions.php find:

function get_server_load()
{
	global $lang;

	$serverload = array();

	// DIRECTORY_SEPARATOR checks if running windows
	if(DIRECTORY_SEPARATOR != '\\')
	{
		if(@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]);
			if(!is_array($serverload))
			{
				return $lang->unknown;
			}
		}
	}
	else
	{
		return $lang->unknown;
	}

	$returnload = trim($serverload[0]);

	return $returnload;
}

Replace with:

function get_server_load()
{
	global $lang;
	return $lang->unknown;
}
Tikitiki Wrote:In functions.php find:

function get_server_load()
{
	global $lang;

	$serverload = array();

	// DIRECTORY_SEPARATOR checks if running windows
	if(DIRECTORY_SEPARATOR != '\\')
	{
		if(@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]);
			if(!is_array($serverload))
			{
				return $lang->unknown;
			}
		}
	}
	else
	{
		return $lang->unknown;
	}

	$returnload = trim($serverload[0]);

	return $returnload;
}

Replace with:

function get_server_load()
{
	global $lang;
	return $lang->unknown;
}

thanks for this tip