Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Topic started by: serge06 on December 13, 2017, 10:56:20 AM

Title: Fatal error: Function name must be a string
Post by: serge06 on December 13, 2017, 10:56:20 AM
Hi, I am trying to upgrade from a very old SMF 1.115 to the latest, followed the upgrade procedure, when trying to access the upgraded.php for the first time get: Fatal error: Function name must be a string in /upgrade.php on line 859

Line 859 is a "perfect string":
   // Load the modSettings data...
      $request = $smcFunc['db_query']('', '

Please help.
Title: Re: Fatal error: Function name must be a string
Post by: Sir Osis of Liver on December 13, 2017, 11:51:38 AM
Are you trying to upgrade directly from 1.1.15 to 2.0.15?  Which version of php is your server running?
Title: Re: Fatal error: Function name must be a string
Post by: serge06 on December 13, 2017, 12:55:41 PM
Yes,
PHP Version   5.6.24
Title: Re: Fatal error: Function name must be a string
Post by: Kindred on December 13, 2017, 01:01:48 PM
are you sure?  The error suggests otherwise.
Title: Re: Fatal error: Function name must be a string
Post by: serge06 on December 13, 2017, 03:14:26 PM
Yes, here's the copy from cpanel server info:

Apache Version   2.4.18
PHP Version   5.6.24
MySQL Version   10.1.29-MariaDB
Architecture   x86_64
Operating System   linux

What is the requirement?
Title: Re: Fatal error: Function name must be a string
Post by: Illori on December 13, 2017, 03:19:41 PM
5.4 is the minimum currently. can you run a phpinfo page and verify that is what is actually being run on the server?
Title: Re: Fatal error: Function name must be a string
Post by: serge06 on December 13, 2017, 08:22:03 PM
You guys were correct, even though PHP  version was appearing higher, it was actually below version 5.4 for this site on a shared host. I am now able to access the upgrade.php but get 530 Login authentication failed no matter what I try. I was definitely entering the correct credentials for the forum admin, then disabled the $disable_security = 1; Yet, I still get the same 530 Login authentication failed even after trying another browser, when accessing the upgrade.php
Title: Re: Fatal error: Function name must be a string
Post by: Sir Osis of Liver on December 13, 2017, 09:02:30 PM
530 is a server error, who is your host?  Is there an .htaccess in your root?
Title: Re: Fatal error: Function name must be a string
Post by: serge06 on December 13, 2017, 09:55:13 PM
Hostdime
There is a htaccess

# Custom Legacy PHP 5.4 handler placed by host
AddType application/x-httpd-php54 .php5 .php4 .php .php3 .php2 .phtml
suPHP_ConfigPath /usr/local/lib/php54.ini
# End Custom Legacy PHP 5.4 handler placed by host

I guess theses how they overrode so that just this directory uses the php 5.4--is this login to work?

The rest of my site is built with Joomla 1.5-- pretty old and requires older PHP but it's working just fine so we never had the need to upgrade it.
Title: Re: Fatal error: Function name must be a string
Post by: Sir Osis of Liver on December 13, 2017, 10:07:21 PM
Can you revert to 1.1.15 and get the forum running?
Title: Re: Fatal error: Function name must be a string
Post by: serge06 on December 13, 2017, 10:52:36 PM
Yes
Title: Re: Fatal error: Function name must be a string
Post by: Sir Osis of Liver on December 14, 2017, 03:23:54 PM
Rename the .htaccess file .htaccess_sav, revert to 1.1.15, upgrade to 1.1.21, see if you can get it working there, then try upgrading to 2.0.15.  Run phpinfo (file attached) to confirm php version.
Title: Re: Fatal error: Function name must be a string
Post by: serge06 on December 14, 2017, 08:38:56 PM
OK, I will try that--it is turning into a project. BTW, one of the reasons I am trying to upgrade is because the forum is overwhelmed with spammers, does the new version offer more controls over spammers?
Title: Re: Fatal error: Function name must be a string
Post by: Irisado on December 15, 2017, 05:54:59 AM
This page explains your anti-spam options for 2.0.x: https://wiki.simplemachines.org/smf/Spam_-_my_forum_is_flooded_with_spam,_what_can_I_do
Title: Re: Fatal error: Function name must be a string
Post by: serge06 on December 15, 2017, 03:33:02 PM
I could only upgrade to 1.1.21. Is there any way to add the custom questions during the new member registration, in this version?
Title: Re: Fatal error: Function name must be a string
Post by: Illori on December 15, 2017, 03:51:33 PM
you really need to upgrade to SMF 2.0 as SMF 1.1 is no longer getting security patches.
Title: Re: Fatal error: Function name must be a string
Post by: Sir Osis of Liver on December 15, 2017, 09:42:29 PM
Want went wrong?
Title: Re: Fatal error: Function name must be a string
Post by: serge06 on December 17, 2017, 12:49:33 PM
Sorry for the delay, I got another php error, so I gave up with upgrading to 2.0. I cleaned the forum from spam, assigned moderators, and it is all working with 1.1.21. It is not a super popular forum, for a local residential community of about 6000. I also have a forest theme and a couple of packages installed, that would probably not be available on the 2.0 forum.
One question though, where could I insert the social media share buttons ( I have the code) so that they appear within each new post? Would it be inside Post.php, and if so, what's the line that I am looking for? I realize it's a hack, but since I will not be upgrading the forum this will suffice. Thanks for all your help.
Title: Re: Fatal error: Function name must be a string
Post by: Arantor on December 17, 2017, 03:42:00 PM
There are known security holes in 1.1.x that will not be fixed as it is no longer maintained. I'd also be surprised if there are many mods that aren't available in a 2.0 version at this point. Fairly sure the Forest theme was updated.
Title: Re: Fatal error: Function name must be a string
Post by: Sir Osis of Liver on December 17, 2017, 10:00:24 PM
If you remain at 1.1.21, you're going to have problems once your host upgrades your account beyond php 5.4 (per this (https://www.simplemachines.org/community/index.php?topic=534915.0)).  You'll be logging tons of errors and things will start breaking.  If you can pm admin and ftp access I'll see if I can determine why upgrade fails.

If you want to add things to posts, it would be in Display.template.php.
Title: Re: Fatal error: Function name must be a string
Post by: Sir Osis of Liver on December 18, 2017, 09:30:35 PM
Your server is running php 5.3.29, you must upgrade at least to 5.4 if you want to run SMF 2.0.15.  upgrade.php should run (haven't tried it), but forum will not.  You may be able to upgrade php in your host control panel, if not ask your host to do it.  Php 5.3 went eol over 3 years ago, currently supported versions are 5.6, 7.0, 7.1, 7.2.  I'm using 5.6.32, works fine with all things SMF.  Let me know when it's upgraded, and I'll upgrade your forum.
Title: Re: Fatal error: Function name must be a string
Post by: Aleksi "Lex" Kilpinen on December 21, 2017, 03:00:25 PM
I could only upgrade to 1.1.21. Is there any way to add the custom questions during the new member registration, in this version?
You could continue updating by using the large upgrade package. Or did you try this already and hit a problem?
Title: Re: Fatal error: Function name must be a string
Post by: serge06 on December 21, 2017, 03:04:08 PM
I PM'ed the server login to one of the admins, so hopefully he is looking into the issue.
Title: Re: Fatal error: Function name must be a string
Post by: Aleksi "Lex" Kilpinen on December 21, 2017, 03:09:41 PM
OK, let us know if you need further assistance, or if you feel this topic has served it's purpose you can mark the topic solved as well. :)