Previous Thread
Next Thread
Print Thread
Hop To
Fatal Error when checking user #258906 01/16/2017 3:28 PM
Joined: Aug 2006
Posts: 583
Basil Offline OP
old hand
OP Offline
old hand
Joined: Aug 2006
Posts: 583
When clicking the check user button in the new member queue, I get this following error:

Fatal error: Call to undefined function iconv() in /home/myforum/public_html/libs/user.inc.php on line 639

This just started happening. I did recently move to a new server with new IP but URLs are all the same. Any ideas?

Re: Fatal Error when checking user [Re: Basil] #258907 01/16/2017 3:36 PM
Joined: Apr 2004
Posts: 1,530
isaac Offline
UBB.threads Developer
Offline
UBB.threads Developer
Joined: Apr 2004
Posts: 1,530
1) Are you allowing special characters in user names?
2) Did you just recently switch your database tables from ISO-8859-1 to UTF-8?


iconv has to do with multibyte characters. Does your new server have the iconv() library installed
https://www.hackersgarage.com/iconv-php-extension-installation-without-recompiling-php.html

Attached Files 20170116_11-35-17.PNG

Current developer of UBB.threads PHP Forum Software // 7.7.3 released!
isaac @ id242.com // my forum @ CelicaHobby.com
Re: Fatal Error when checking user [Re: isaac] #258908 01/16/2017 7:39 PM
Joined: Aug 2006
Posts: 583
Basil Offline OP
old hand
OP Offline
old hand
Joined: Aug 2006
Posts: 583
Originally Posted by id242
1) Are you allowing special characters in user names?
2) Did you just recently switch your database tables from ISO-8859-1 to UTF-8?


iconv has to do with multibyte characters. Does your new server have the iconv() library installed
https://www.hackersgarage.com/iconv-php-extension-installation-without-recompiling-php.html


I'll bet that's it. Thanks!

Re: Fatal Error when checking user [Re: Basil] #258989 01/27/2017 12:02 AM
Joined: Aug 2006
Posts: 583
Basil Offline OP
old hand
OP Offline
old hand
Joined: Aug 2006
Posts: 583
UPDATE - Yes, indeed installing iconv got rid of the error, but now I have a related question.

When I click on Check This User, the spam checker never shows anything for Email Status or Reg. IP status. Seems I got some indications before I changed servers. Any idea what else might be needed to make this function properly?

Re: Fatal Error when checking user [Re: Basil] #259037 02/02/2017 7:23 PM
Joined: Jun 2006
Posts: 15,844
Gizmo Offline
UBB.threads Developer
Offline
UBB.threads Developer
Joined: Jun 2006
Posts: 15,844
Basil, I would check your error logs and see if you're getting and 403 requests, it's possible that the suhosin module on your server is killing the connection; it is also possible that your host has configured fsockopen to not allow connections to outside servers (generally done as a form of security, but really breaks things that rely on 3rd party databases).

As for the aforementioned error, these are generally covered in the UBB.threads System Requirements Test, you might give it a run to see if there are any detectable issues that it can find with your server configuration.


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Need to Upgrade?
Forums: A Gardeners Forum Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Re: Fatal Error when checking user [Re: Gizmo] #259053 02/06/2017 1:35 PM
Joined: Aug 2006
Posts: 583
Basil Offline OP
old hand
OP Offline
old hand
Joined: Aug 2006
Posts: 583
Gizmo, I don't see any 403 errors. I ran the System Requirements test and it shows no issues. Here's a dumb question. I can see in the test_stopforumspam.php that the script makes a connection to www.stopforumspam.com My question(s):

1. Is it possible my new server's IP is blocked by them and
2. When I look on that web site, it appears I may need an "API Key?" Thing is, this script was working before I moved to the new server.

Re: Fatal Error when checking user [Re: Basil] #259054 02/06/2017 1:42 PM
Joined: Jun 2006
Posts: 15,844
Gizmo Offline
UBB.threads Developer
Offline
UBB.threads Developer
Joined: Jun 2006
Posts: 15,844
Originally Posted by Basil
1. Is it possible my new server's IP is blocked by them
Doubtful, but their developer is a pretty cool guy, feel free to just outright ask him if your server is blacklisted (I can't see why they'd have you blacklisted; a large chance is that your host is blocking outside connections to file_get_contents).

Originally Posted by Basil
2. When I look on that web site, it appears I may need an "API Key?" Thing is, this script was working before I moved to the new server.
Stop Forum Spam requires an API Key to send data to their database; a key is not required to send a remote query with file_get_contents, but file_get_contents needs to be able to contact to "the outside world" (some webhosts restrict remote content).


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Need to Upgrade?
Forums: A Gardeners Forum Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Re: Fatal Error when checking user [Re: Basil] #259055 02/06/2017 1:48 PM
Joined: Aug 2006
Posts: 583
Basil Offline OP
old hand
OP Offline
old hand
Joined: Aug 2006
Posts: 583
Ok, thanks. I am submitting a ticket to my server management to see of they can see why it might not be working.

Re: Fatal Error when checking user [Re: Basil] #259056 02/06/2017 3:43 PM
Joined: Aug 2006
Posts: 583
Basil Offline OP
old hand
OP Offline
old hand
Joined: Aug 2006
Posts: 583
They don't see any issues that would block the stopforumspam web site. However, in poking around in the stop forum spam script I notice something interesting / strange. If you look at this code where the stopforumspam API is contacted:

PHP Code
// Check API Status in a popup

if ($op == 'test') {
$xmlResult = @file_get_contents("http://www.stopforumspam.com/api?ip=". $_SERVER["SERVER_ADDR"]);
if(
$xmlResult != false) {
$xml = new SimpleXMLElement($xmlResult);
if(
$xml->appears == 'no') {
$SFS_Status_Class = 'sfsgood';
$SFS_Status = $ubbt_lang['SFS_STAT_GOOD'];
} else {
$SFS_Status_Class = 'sfsbad';
$SFS_Status = $ubbt_lang['SFS_STAT_BAD'];


When I go into the Stop Forum Spam control panel and click "test connectivity" I get a popup that I think SHOULD say either "Can Connect" or if it is not connecting, it should say "Can't Connect" But instead I get blank for IP Status. Any other ideas or thoughts?

Re: Fatal Error when checking user [Re: Basil] #259057 02/06/2017 3:52 PM
Joined: Jun 2006
Posts: 15,844
Gizmo Offline
UBB.threads Developer
Offline
UBB.threads Developer
Joined: Jun 2006
Posts: 15,844
Remove that @ before file_get_contents and tell me if it throws an error.

As for your report about the status page, are you at the right page for the data you want? There are two of them, one, which has the api status test is pretty bare:
CP -> Master Settings -> Primary Settings -> Stop Forum Spam -> Test Connectivity

The other is when you're looking at a member and click "More Info" which has, more information.

The strings on the Test connectivity page are just:
$ubbt_lang['SF_SPAM'] = "Stop Forum Spam";
$ubbt_lang['SFS_STAT_DESC'] = "API Status: ";
$ubbt_lang['SFS_STAT_GOOD'] = "Can Connect";
$ubbt_lang['SFS_STAT_BAD'] = "Can Not Connect";
$ubbt_lang['SFS_TEST_IT'] = "Test Connectivity";

If the language strings do NOT load on these pages, you may not have the languages/english/admin/stop_forum_spam.php language file in place.

I wrote yet another test script for file_get_contents (there really isn't anything we can do at this point, it's a simple request from your server to their server, if something is found it just sorts the file):
PHP Code

<?php

$payload
= "91.200.13.3";

if(
function_exists("file_get_contents")) {
$fetch = file_get_contents("https://api.stopforumspam.org/api?ip=". $payload);
if(
$fetch != false) {
if(
$fetch != "Error") {
$xml = new SimpleXMLElement($fetch);

if(
$xml->appears == "yes") {
echo(
"We could connect to the Stop Forum Spam Database and have checked the dataset specified, the user \"". $payload ."\" is a spammer.");
} else {
echo(
"We could connect to the Stop Forum Spam Database and have checked the dataset specified, the user \"". $payload ."\" is <b>not</b> a spammer.");
}
} else {
echo(
"There was an error with the response from the Stop Forum Spam Database.");
}
} else {
echo(
"We could not establish a connection to the Stop Forum Spam Database, please ensure that your webhost does not restrict outside connections via the \"file_get_contents\" PHP Function.");
}
} else {
echo(
"The PHP function \"file_get_contents\" does not exist on this server.");
}
?>



You could also try my check new version code:
PHP Code

<?php

$build
= "20170101";
if(
function_exists("file_get_contents")) {
$source = file_get_contents("https://www.ubbwiki.com/latest/check/system-requirement-test");

if(
version_compare($source, $build, ">")) {
echo(
"<div style=\"text-align: center;\">\n\t<h2 class=\"heading notice\">Outdated Test Script Version</h2><br>\n</div>\n\nAn upgrade to the UBB.threads System Requirement Test is available, please see <a href=\"https://www.ubbwiki.com/\" target=\"_blank\">UBB.Wiki</a>: <a href=\"https://www.ubbwiki.com/latest/system-requirement-test\" target=\"_blank\">Latest System Requirement Test</a>. <b>Your Build</b>: ". $build ." <b>Latest Build</b>: ". $source ."<br><br>\n\n");
}
}
?>

Attached Files aaa.pngbbb.png

I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Need to Upgrade?
Forums: A Gardeners Forum Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Re: Fatal Error when checking user [Re: Basil] #259058 02/06/2017 4:34 PM
Joined: Aug 2006
Posts: 583
Basil Offline OP
old hand
OP Offline
old hand
Joined: Aug 2006
Posts: 583
Problem Solved! While I did go to SSH and edit php.ini so that allow_url_fopen=on and restarted Apache, apparently I needed to use the "Multi ini tool" in WHM to set it to ON. Once I did that viola! All is working now! Thanks for all the help.


Forum Search
ShoutChat Box
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Having issue with redirects to UBB classic URLs
by amciotola - 10/16/2019 1:11 AM
Unable to save General settings
by amciotola - 10/13/2019 4:23 AM
I see signature line images, but no avatars
by Morgan - 10/12/2019 2:21 PM
Show PDF
by Geoff - 10/09/2019 1:33 AM
Subscription’s Auto Return URL for PayPal
by Geoff - 09/27/2019 12:10 AM
Who's Online Now
2 registered members (Ruben, JAISP), 66 guests, and 220 spiders.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Amusing Terain Scenics
Amusing Terain Scenics
by isaac, August 19
Sky places
Sky places
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Snapshot build 20190930)