PHP Fatal error: Function name must be a string

Started by BenQ, June 21, 2011, 11:30:11 AM

Previous topic - Next topic

BenQ

Hi,

Just upgraded my forum (www.gspendragon.com/roundtable) to the new stable version 2 from the latest version of 1.x . All went beautifully well, solving a few problems that we had with the old version. I then tried to update my anti-spam mod and ruined the day! If I try and visit the site now I get:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.


I tried reinstalling the smf software again and running upgrade.php as in the install, but this throws up the same message.

Checking the error log I get:
PHP Fatal error:  Function name must be a string in /home/gspendra/public_html/roundtable/Sources/Load.php on line 142

If I check or repair the database through the websites cpanel, using 'MySQL Databases' it tells me all is ok.

Any ideas?

I've attached my Load.php

Many thanks,

Ben

BenQ

The mod I was trying to install was StopSpammer_v2_3_9.zip (I had had 2_3_7 installed prior to upgrading forum and thought I should update this whilst I was at it)

hadesflames

The function being called in line 142 is the smf_db_query() function via smcFunc. It would make sense if smcFunc were not in scope at time of execution, but it should be as it's globaled at the beginning of the function =/

On top of that, stop spammer does not edit Load.php at all, nor should such an error cause a 500 error (but I guess anything is possible depending on the server)

Are you sure that the error you've posted above is current? (As in, it only started showing up in your error log after you started receiving your 500)

BenQ

I believe it is so. When I downloaded the error log this is what it said:

[07-Apr-2011 05:59:14] PHP Fatal error:  Allowed memory size of 33554432 bytes exhausted (tried to allocate 11061591 bytes) in Unknown on line 0
[21-Jun-2011 08:49:58] PHP Fatal error:  Function name must be a string in /home/gspendra/public_html/roundtable/Sources/Load.php on line 142
[21-Jun-2011 08:56:09] PHP Fatal error:  Function name must be a string in /home/gspendra/public_html/roundtable/Sources/Load.php on line 142
[21-Jun-2011 08:56:23] PHP Fatal error:  Function name must be a string in /home/gspendra/public_html/roundtable/Sources/Load.php on line 142
[21-Jun-2011 08:56:24] PHP Fatal error:  Function name must be a string in /home/gspendra/public_html/roundtable/Sources/Load.php on line 142
[21-Jun-2011 08:57:39] PHP Fatal error:  Function name must be a string in /home/gspendra/public_html/roundtable/Sources/Load.php on line 142
[21-Jun-2011 08:57:40] PHP Fatal error:  Function name must be a string in /home/gspendra/public_html/roundtable/Sources/Load.php on line 142
[21-Jun-2011 08:57:43] PHP Fatal error:  Function name must be a string in /home/gspendra/public_html/roundtable/Sources/Load.php on line 142
[21-Jun-2011 08:58:49] PHP Fatal error:  Function name must be a string in /home/gspendra/public_html/roundtable/Sources/Load.php on line 142
[21-Jun-2011 09:04:09] PHP Fatal error:  Function name must be a string in /home/gspendra/public_html/roundtable/Sources/Load.php on line 142


Have no idea what the first error was, but every other error occurred today after the failed/aborted installation

BenQ

The installation of the mod failed part way through if that makes any difference.

hadesflames


BenQ

It asked which themes I wanted to apply the mod upgrade to - it had to overwrite some details in the themes outside the default theme. I set it to do this for all of them and pressed ok / install. I can't remember how the process finished, I was doing other things at the same time (ok, a mistake!) but when I returned to the forum it was replaced by the error page. I don't remember exactly what was on the screen before I went to the forum page, but something made me think it had gone wrong.

hadesflames

So wait, instead of uninstalling the old version, and the installing the new one, you performed a mod upgrade? (Which is basically installing the new mod while the old mod is still installed)

BenQ


hadesflames

It might be the case, as that mod doesn't seem to support those kinds of upgrades. Not a lot of mods do actually, you should generally uninstall the old and install the new to avoid any problems. Most mods won't get rid of any saved data (such as settings and what not) so that you can safely perform an upgrade in this way (mine definitely do)

Try doing it this way.

BenQ

Sorry, are you suggesting I need to remove the mod and reinstall it to get the forum working again? If so, how do I go about that when I can not access the admin panel of the forum?

hadesflames

You can replace all your files with those from the 2.0 large upgrade, although this would mean all your mods would be uninstalled (at least your site should be back)

Although one thing that comes to mind, if you did a large upgrade, does that mean you installed the 2.3.7 version and THEN tried upgrading to 2.3.9?

BenQ

I had 2.3.7 installed and working fine before I upgraded SMF to 2.0 using the large upgrade. After that I tried to upgrade to 2.3.9.

Just to make sure I've got this right, are you saying I should delete the contents of the forum folder (in my case gspendragon/roundtable) and then add to the forum folder the files from the large upgrade and then run the upgrade.php file again?

Or

Are you suggesting that I simply upload the large upgrade files over the top of the current contents of the folder and then run upgrade.php again?

If the former - does this preserve the posts/members etc.? How do I keep custom avatars and any attachments to peoples posts?

If the latter, I tried this earlier and upgrade.php wouldn't run, instead I got the error window that's there now.

Thanks for you help!

hadesflames

Ok, so you upgraded your forum to 2.0 and installed the 2.3.7 version of the mod and THEN decided to upgrade it to 2.3.9 right? I need to be sure because that's what I'm understanding atm.

If that's the case, then all you need to do is the latter of what you suggested (just overwrite the files, not delete everything) also, you don't have to run the upgrade.php script, so after you've uploaded everything make sure you delete all the files in your forum index with "upgrade" in the name. Be sure to post here with your answer before proceeding.

BenQ

Not quite.

1) I already had 2.3.7 Stop Spammer installed when I was running SMF 1.x

2) I then upgraded SMF to 2.0.

3) Then I tried to install 2.3.9 over the top of 2.3.7

hadesflames

Installing 2.0 final, regardless of what version of SMF you were on previously, implies that all of your mods were uninstalled. So you didn't really install 2.3.9 over 2.3.7...

BenQ

Oh... Didn't realise that.

Any ideas what may have happened then? I thought I had seen in the admin panel that after the larger upgrade install of 2.0 that Stop Spammer was installed, but maybe what I recall seeing was the existence of Stop Spammer, but only as present, not installed.

Is your advice still to try and remove the mod as it was after installing 2.3.9 that it went wrong? If so, can you tell me what I should do?

Thanks again

hadesflames

Assuming your original 2.0 upgrade went off without a hitch, try just replacing the files with fresh 2.0 files, which should get you back up for now. Then delete the 2.3.7 and install 2.3.9 see what happens. If it dies again, then get rid of stop spammer. There are other spam prevention mods out there that get the job done quite well (I heard good things about bad behaviour from Arantor, and it's currently installed on EP.net)

BenQ

Ok, so I don't delete anything just overwrite the present files with the 2.0 large upgrade files and the delete all the files in the forum index with "upgrade" in the name. I tried this earlier, but I'll give it another shot without then attempting to run upgrade.php and see if it makes any difference.

hadesflames


Advertisement: