RE: Simple Machine Forum - Blank Screen on Load / Switching Pages
09-24-2015, 12:43 AM
(This post was last modified: 09-24-2015, 06:44 AM by MarkDark.
Edit Reason: Check versions
)
Hi!
Everyone who appears when you run Simple Machine Forum white page, see this post!
Problem:
You tried installing Simple Machines Forum software (SMF) either from the source website or using Sentastico, but it shows as a blank page when you try to access it. No issues are seen in the ZpanelX or Sentora Error Log and all other configurations appear to be correct.
Solution :
This issue is caused by suhosin security module which blocks the PHP function shell_exec() from being used. However, SMF appears to call this function in the Sources/Subs.php file, around line 3737: (for version 2.0.11)
// Try the Linux host command, perhaps?
if (!isset($host) && (strpos(strtolower(PHP_OS), ‘win’) === false || strpos(strtolower(PHP_OS), ‘darwin’) !== false) && mt_rand(0, 1) == 1)
{
if (!isset($modSettings[‘host_to_dis’]))
$test = @shell_exec(‘host -W 1 ‘ . @escapeshellarg($ip));
else
$test = @shell_exec(‘host ‘ . @escapeshellarg($ip));
// Did host say it didn’t find anything?
if (strpos($test, ‘not found’) !== false)
$host = ”;
// Invalid server option?
elseif ((strpos($test, ‘invalid option’) || strpos($test, ‘Invalid query name 1′)) && !isset($modSettings[‘host_to_dis’]))
updateSettings(array(‘host_to_dis’ => 1));
// Maybe it found something, after all?
elseif (preg_match(‘~\s([^\s]+?)\.\s~’, $test, $match) == 1)
$host = $match[1];
}
This code block should be commented out by adding PHP comment tags :
// Try the Linux host command, perhaps?
/* if (!isset($host) && (strpos(strtolower(PHP_OS), ‘win’) === false || strpos(strtolower(PHP_OS), ‘darwin’) !== false) && mt_rand(0, 1) == 1)
{
if (!isset($modSettings[‘host_to_dis’]))
$test = @shell_exec(‘host -W 1 ‘ . @escapeshellarg($ip));
else
$test = @shell_exec(‘host ‘ . @escapeshellarg($ip));
// Did host say it didn’t find anything?
if (strpos($test, ‘not found’) !== false)
$host = ”;
// Invalid server option?
elseif ((strpos($test, ‘invalid option’) || strpos($test, ‘Invalid query name 1′)) && !isset($modSettings[‘host_to_dis’]))
updateSettings(array(‘host_to_dis’ => 1));
// Maybe it found something, after all?
elseif (preg_match(‘~\s([^\s]+?)\.\s~’, $test, $match) == 1)
$host = $match[1];
} */
This will fix the issue and allow SMF to work properly. The function is not necessary for the normal operation of the script, as other means are available to SMF to accomplish the same thing.
Source: http://www.supportpro.com/blog/2013/09/s...t-working/
Everyone who appears when you run Simple Machine Forum white page, see this post!
Problem:
You tried installing Simple Machines Forum software (SMF) either from the source website or using Sentastico, but it shows as a blank page when you try to access it. No issues are seen in the ZpanelX or Sentora Error Log and all other configurations appear to be correct.
Solution :
This issue is caused by suhosin security module which blocks the PHP function shell_exec() from being used. However, SMF appears to call this function in the Sources/Subs.php file, around line 3737: (for version 2.0.11)
// Try the Linux host command, perhaps?
if (!isset($host) && (strpos(strtolower(PHP_OS), ‘win’) === false || strpos(strtolower(PHP_OS), ‘darwin’) !== false) && mt_rand(0, 1) == 1)
{
if (!isset($modSettings[‘host_to_dis’]))
$test = @shell_exec(‘host -W 1 ‘ . @escapeshellarg($ip));
else
$test = @shell_exec(‘host ‘ . @escapeshellarg($ip));
// Did host say it didn’t find anything?
if (strpos($test, ‘not found’) !== false)
$host = ”;
// Invalid server option?
elseif ((strpos($test, ‘invalid option’) || strpos($test, ‘Invalid query name 1′)) && !isset($modSettings[‘host_to_dis’]))
updateSettings(array(‘host_to_dis’ => 1));
// Maybe it found something, after all?
elseif (preg_match(‘~\s([^\s]+?)\.\s~’, $test, $match) == 1)
$host = $match[1];
}
This code block should be commented out by adding PHP comment tags :
// Try the Linux host command, perhaps?
/* if (!isset($host) && (strpos(strtolower(PHP_OS), ‘win’) === false || strpos(strtolower(PHP_OS), ‘darwin’) !== false) && mt_rand(0, 1) == 1)
{
if (!isset($modSettings[‘host_to_dis’]))
$test = @shell_exec(‘host -W 1 ‘ . @escapeshellarg($ip));
else
$test = @shell_exec(‘host ‘ . @escapeshellarg($ip));
// Did host say it didn’t find anything?
if (strpos($test, ‘not found’) !== false)
$host = ”;
// Invalid server option?
elseif ((strpos($test, ‘invalid option’) || strpos($test, ‘Invalid query name 1′)) && !isset($modSettings[‘host_to_dis’]))
updateSettings(array(‘host_to_dis’ => 1));
// Maybe it found something, after all?
elseif (preg_match(‘~\s([^\s]+?)\.\s~’, $test, $match) == 1)
$host = $match[1];
} */
This will fix the issue and allow SMF to work properly. The function is not necessary for the normal operation of the script, as other means are available to SMF to accomplish the same thing.
Source: http://www.supportpro.com/blog/2013/09/s...t-working/