Thanks, I will not double post.
It should not be an issue with the Hosting Provider, because this Mod was working properly for me previously on the same hosting. The only thing which has changed from before is the SMF version which was upgraded.
I checked the source code of StopSpammer.php and I think it uses the following code snippet to test the connection in checkDBSpammer() function:
$remoteXML = 'http://www.stopforumspam.com/api?' . ('127.0.0.1' != $check_ip ? ($modSettings['stopspammer_check_ip'] ? 'ip=' . $check_ip . '&' : '') : '') . ($modSettings['stopspammer_check_name'] ? 'username=' . urlencode($check_name) . '&' : '') . ($modSettings['stopspammer_check_mail'] ? 'email=' . urlencode($check_mail) : '');
// Try to download.
require_once($sourcedir . '/Subs-Package.php');
$down_ok = fetch_web_data($remoteXML);
// Test Host Connection
if ($test) return (bool)$down_ok;
// Connection Failed
if (!$down_ok)
if ($modSettings['stopspammer_faildb'])
return ('1' == $modSettings['stopspammer_faildb'] ? 0 : 8);
if $down_ok is set to 0, then it will display the faildb error.
The permissions for both, StopSpammer.php and Subs-Package.php are set to 640. Could this problem arise due to the permission settings of these two files?
Could you please confirm what should be the settings for these two?
I can try uninstalling and reinstalling the mod as well as an option.
This mod was installed around 1 week ago and the connection failure issue with the SFS database still persists.
***************************************
Edit:
I checked it further and the fetch_web_data() function called by StopSpammer.php to connect to stopforumspam.com API is defined in Subs-Package.php.
And yes, it appears that it makes use of fsockopen():
// Get the contents of a URL, irrespective of allow_url_fopen.
function fetch_web_data($url, $post_data = '', $keep_alive = false, $redirection_level = 0)
{
global $webmaster_email;
static $keep_alive_dom = null, $keep_alive_fp = null;
....
...
if (empty($fp))
{
// Open the socket on the port we want...
$fp = @fsockopen(($match[2] ? 'ssl://' : '') . $match[3], empty($match[5]) ? ($match[2] ? 443 : 80) : $match[5], $err, $err, 5);
if (!$fp)
return false;
}
***************************************************
Edit again:
I just uploaded a PHP script to my site through FTP to check the settings of PHP.ini and fsockopen() is not disabled:
disable_functions: link,symlink
only the link() and symlink() functions are disabled.
Thanks.