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


BenQ

Hmmm, no joy I'm afraid.
Still getting:

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.

Apache/1.3.42 Server at www.gspendragon.com Port 80



BenQ

Also just double checked the CHMOD settings for:


  • attachments
  • avatars
  • Packages
  • Packages/installed.list
  • Smileys
  • Themes
  • Themes/default/languages/Install.english.php
  • agreement.txt
  • Settings.php
  • Settings_bak.php

Of these some were 755 instead of 777. The Install.english was 6?? Changed all to 777

Still no change.

Also tried after this uploading the upgrade*.php files and running that again. No joy. removed them again.

Illori


BenQ

I'll give that a try. Which ones specifically - all in the forum folder, or simply those listed above?

Illori


BenQ

Thanks.

All done (what a lot of files and folders - thank God for multiple select options!) I fear no change though...

Illori

have you contacted your host to have them take a look?

BenQ


BenQ

#28
Request for the hosting company to look at it sent - but aware that this might take some time (I'm not the owner of the site and so don't have the passwords needed to go through the proper channels etc.) Any other advice in the meantime will be gratefully received!

Going to show my ignorance here (a newbie at forums/databases). I'm assuming the content of posts and lists of members are kept in php database files which are in a different location to the forum folder? Is it possible for me to copy the forum folder to my computer as a backup, delete the forum folder's contents on the server and then do a complete new installation of SMF in its place into that folder and then link it back to the original database? Might this possibly help?

BenQ

The hosting company restored the site to a backup the day before the site failed, and so in theory to a time before I upgraded the SMF to 2.0 and the subsequent attempt to update the Stop Spammer mod. I had hoped that this would do the trick but I'm still getting an error message; this time:

: Unknown column 'a.attachmentType' in 'field list'
/home/gspendra/public_html/roundtable/Sources/Load.php
390


I've attached the restored Load.php

When the hosting company informed me that they had restored the site, they too noted that there was still an error, but a different one than I'm getting. They got:

Database Error: Unknown column 'addDeny' in 'field list'
File: /home/gspendra/public_html/roundtable/Sources/Load.php
Line: 739


Can anyone advise me as to what could be wrong now?

Illori

sounds like the upgrade did not get run on the database, confirm that your files are for 2.0 and run the upgrade script again

BenQ

Quote from: Illori on June 27, 2011, 05:36:39 AM
sounds like the upgrade did not get run on the database, confirm that your files are for 2.0 and run the upgrade script again

In theory the backup by the host should have taken the site back to how it was before I started on this whole process - don't understand why its not working! They were supposed to have restored a backup of the database and the site which would have reverted it to 1.x (whatever the latest version of 1 was). I take it you're suggesting I upload the large upgrade files for 2.0 and run upgrade.php again - I ask as I'm not quite sure what you mean by 'confirm your files are for 2.0'.

Thanks again for your help!

Illori

i am not familiar with the last error message, so i am unsure what file/version may cause it to show.

BenQ

Ok, I'll upload 2.0 upgrade and run the upgrade.php and see what happens, then report back

BenQ

Many thanks for all your help - that seems to have sorted out all the problems! Up and running again!

Advertisement: