News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Unidentified Syntax Error

Started by AZMazda3, August 04, 2021, 09:37:41 PM

Previous topic - Next topic

AZMazda3

My forum hasn't been used much this year but we did the patch to 2.0.18 back in February with no known issues, but now new members can't register or modify their current profile without getting a syntax error. We have not done any reason mods, site worked before but starting June 29, 2021 we have all these errors in the logs.

If there is way to check where the issue is I can fix it, but this error isn't helping me.

site/index.php?action=register
syntax error, unexpected 'use' (T_USE), expecting ')'

The site is running PHP 7.3

Here is what packages are currently listed as installed. Yes it needs cleaning up.
1.   SMF 2.0.18 Update   0.1.0   [ Uninstall ]
2.   Tapatalk SMF 2.0 Plugin   4.5.7   [ Uninstall ]
3.   SMF 2.0.17 Update   1.0   [ Uninstall ]
4.   SMF 2.0.16 Update   1.0   [ Uninstall ]
5.   Google Member Map   3.0.4   [ Uninstall ]
6.   SMF 2.0.15 Update   1.0   [ Uninstall ]
7.   SMF 2.0.14 Update   1.0   [ Uninstall ]
8.   SMF 2.0.13 Update   1.0   [ Uninstall ]
9.   SMF 2.0.12 Update   1.0   [ Uninstall ]
10.   SMF 2.0.11 Update   1.0   [ Uninstall ]
11.   Forum Firewall   2.0.0   [ Uninstall ]
12.   Google Analytics Code   1.5.1   [ Uninstall ]
13.   Ad Managment   3.2   [ Uninstall ]
14.   SimplePortal   2.3.6   [ Uninstall ]
15.   SMFPacks Shoutbox   1.0.4


shadav

moved to smf 2.0.x support since this isn't a 2.1 support question

I'd assume the issue is in your Sources folder in the Profile.php
since it's happening when people are trying to modify their profile

though it could be in the Register.php as well

is there any other info with the error?

make sure that the mods that are installed are installed correctly, honestly if those are the only mods that you use, it might just be easier to do a large upgrade and then download the latest versions of the mods and install them, making sure that there are no errors when you install them

and to be honest, I'd ditch the tapatalk mod as it has many issues and I believe is no longer supported.

Antechinus

It wouldn't need a large upgrade as such, since it's already running 2.0.18 (so no need for the upgrade.php process, etc). I think you mean a 2.0.18 file refresh from the upgrade pack. ;)

Is template eval switched on in admin? Should be able to get a full error message from the log if template eval is switched off.

shadav

Quote from: Antechinus on August 04, 2021, 10:26:22 PM
It wouldn't need a large upgrade as such, since it's already running 2.0.18 (so no need for the upgrade.php process, etc). I think you mean a 2.0.18 file refresh from the upgrade pack. ;)
:laugh: yeah that's what I meant  :-[ really should complete my train of thought there
no need to do an upgrade, just replace your files with the files from the upgrade, to reset your forum files to fresh install, no need to upload all of the upgrade.php files in the root folder either

Oldiesmann

The error log should tell you what file the error is occurring in and on what line of that file.
Michael Eshom
Christian Metal Fans

Shambles

Syntax errors don't usually just appear out of the blue; I'm guessing there's a corruption in the cached copy of a script.

I'd start with the easy trial of clearing the cache folder first, though this would confirm or deny it:

Quote from: Oldiesmann
The error log should tell you what file the error is occurring in and on what line of that file.

AZMazda3

#6
Quote from: Antechinus on August 04, 2021, 10:26:22 PM
It wouldn't need a large upgrade as such, since it's already running 2.0.18 (so no need for the upgrade.php process, etc). I think you mean a 2.0.18 file refresh from the upgrade pack. ;)

Is template eval switched on in admin? Should be able to get a full error message from the log if template eval is switched off.

I'll check on this because there is no detail on error log. Checked. By default it was on so I disabled Template Eval but still no new info for the error.

Shambles

Quote from: Shambles on August 05, 2021, 03:55:14 AM
Syntax errors don't usually just appear out of the blue; I'm guessing there's a corruption in the cached copy of a script.

I'd start with the easy trial of clearing the cache folder first, though this would confirm or deny it:

AZMazda3

So I cleared the cache nothing, so I cleared the backlog of 2000+ errors and then cache again. Now I am getting more details on the errors so I'll be going back and checking those as I know how to duplicate the main errors I was having.

Thank you

AZMazda3

Nothing on the critical error still. Although I do have a PHP constructor deprecated error and a couple undefined index errors now. Not sure how to locate this error, what is the "u=3998" referring to?

http://site/index.php?action=profile;area=account;u=3998
syntax error, unexpected 'use' (T_USE), expecting ')'

shadav

depreciated errors means you're using the wrong php level
in your hosting account you will need to change your php to 7.4 for smf 2.0.18
however depending on what mods you use, not all mods have been updated so you may need to use 7.3 or 7.2

the unexpected t_use is something in your theme's (or if your theme doesn't have this file it's in the default theme) profile.template.php or in your sources folder profile.php
a mod that you installed was not installed correctly and messed something up somewhere

so see which of your mods edited the profile files and make sure that it's installed correctly

AZMazda3

Quote from: shadav on August 04, 2021, 10:18:59 PM
moved to smf 2.0.x support since this isn't a 2.1 support question

I'd assume the issue is in your Sources folder in the Profile.php
since it's happening when people are trying to modify their profile

though it could be in the Register.php as well

is there any other info with the error?

make sure that the mods that are installed are installed correctly, honestly if those are the only mods that you use, it might just be easier to do a large upgrade and then download the latest versions of the mods and install them, making sure that there are no errors when you install them

and to be honest, I'd ditch the tapatalk mod as it has many issues and I believe is no longer supported.

I was running PHP 7.3 and tried upgraded to 7.4 but get alot more deprecated errors, host only allows changes to 7.3 7.4 8.0 (which totallly broke the site) I can go back to PHP5.6 which I am currently running and this gave me more detailed white screen errors.

The current critical error is in the Profile-Modify.php file:
         'preload' => create_function() use ($smcFunc, &$context, $cur_profile, $txt)

Advertisement: