Server error 0-Syntax error, unexpected Token „match“

What is the exact issue? I cannot access the homepage?

Did you check logs/ as suggested? You aren’t providing much information to help you. What were you trying to do when this happened?

@Dolby, Some extra information as @Karmalakas suggested would help indeed…
Information that could be handy is:

  • The last entry in Grav’s the log file
  • What has changed since last access of Grav?

Having said that…

If you had searched this forum, you might have found item Still struggling to get Grav to work: 0 - syntax error, unexpected token “match”

In that post, the issue was caused by running Grav 1.6.x on PHP 8.x

Did you perhaps upgrade to PHP 8.x while runing Grav 1.6?

If so, you might try the suggested solution:

My suggestion would be to upgrade Grav to 1.7.+ and upgrade the themes/plugins using:

  • Upgrade Grav: $ bin/gpm selfupgrade
  • Upgrade themes/plugins: $ bin/gpm update

Or you could downgrade PHP.

When upgrading, I would suggest to upgrade on a development machine first… And don’t forget to read the Upgrade guide.

1 Like

Thank you for the feedback!
The issue is that I can’t access it at all anymore, not even as an administrator. Therefore, my question is, how can I update it exactly?

I just can’t get in. When I try to log in as an administrator, the message keeps appearing. I’ve tried it from both my computer and my tablet.


I asked:

Did you perhaps upgrade to PHP 8.x while runing Grav 1.6?

I guess this is the cause, but you haven’t confirmed it yet.

Other questions:

  • What is your level of experience with Grav and the OS (Linux?) being used?
  • Dou have have access to the command prompt on the server. E.g. using SSH?
  • Can you somehow copy files and autoinstall Grav?
  • Do you have a development environment on which the website has been developed?
  • Is this “just a simple private” website, or a production server of a company?
  • Any other relevant info you could provide?

Please know that you might be helped better if you provide proper information instead of restating that you cannot access the website…