Unsupported strict_types in... ---AND--- Syntax error, unexpected ':' expecting ';' or '{' in ...

Having trouble installing serendipity?
Post Reply
Stosh
Regular
Posts: 74
Joined: Mon Oct 12, 2009 11:47 pm

Unsupported strict_types in... ---AND--- Syntax error, unexpected ':' expecting ';' or '{' in ...

Post by Stosh » Sat Dec 14, 2019 9:14 pm

I'm trying to upgrade to the latest version so that I can upgrade my hosting to a better version (one with AWStats). I followed the instructions and chose to have you automatically deal with the list of issues. This is what I get when I go there.

Code: Select all

 

Warning: Unsupported declare 'strict_types' in /home/content/17/8990017/html/p/johnrepici_com/httpdocs/serendipity/bundled-libs/voku/simple-cache/src/voku/cache/CacheAdapterAutoManager.php on line 3

Parse error: syntax error, unexpected ':', expecting ';' or '{' in /home/content/17/8990017/html/p/johnrepici_com/httpdocs/serendipity/bundled-libs/voku/simple-cache/src/voku/cache/CacheAdapterAutoManager.php on line 32

Just an aside. My other blog is a total mess now that I've upgraded the host from PHP 5.2.17 to PHP 5.4.

[PS: Quick correction I had the PHP version set to 5.6. Just tried 5.4 and the upgraded blog, as well as the non-upgraded blog are still the same messes]

-djr
Last edited by Stosh on Sat Dec 14, 2019 10:38 pm, edited 1 time in total.

Stosh
Regular
Posts: 74
Joined: Mon Oct 12, 2009 11:47 pm

Re: Unsupported strict_types in... ---AND--- Syntax error, unexpected ':' expecting ';' or '{' in ...

Post by Stosh » Sat Dec 14, 2019 9:38 pm

Oops P.P.S.

It looks like something has changed (maybe as the hosting service got the PHP downgraded from 5.6 to 5.4). Here's the new error message:

Code: Select all


Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /home/content/17/8990017/html/p/johnrepici_com/httpdocs/serendipity/include/functions.inc.php on line 1385


Just an update:
I uploaded the new files over my other blog (since there was no way to return back to the old PHP version), and I'm now getting the same "line 1385" error message on that blog as well. (.../include/functions.inc.php on line 1385 --- as in the above code snippet).


Ok, one last update:
I upgraded the PHP back to 5.6, and now both blogs have the original error messages shown in the top post. After switch to PHP 5.6, the second blog upgrade gave me the message where it listed a bunch of issues (no red buttons, btw) and asked if I would like it to fix them all. I said yes (just like on the first blog) and (eventually) got to a white screen with the same two error messages. Both blogs now show them. Specifically:

Code: Select all

Warning: Unsupported declare 'strict_types' in /home/content/17/8990017/html/p/johnrepici_com/httpdocs/serendipity/bundled-libs/voku/simple-cache/src/voku/cache/CacheAdapterAutoManager.php on line 3

Parse error: syntax error, unexpected ':', expecting ';' or '{' in /home/content/17/8990017/html/p/johnrepici_com/httpdocs/serendipity/bundled-libs/voku/simple-cache/src/voku/cache/CacheAdapterAutoManager.php on line 32



-djr

User avatar
onli
Regular
Posts: 2280
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Unsupported strict_types in... ---AND--- Syntax error, unexpected ':' expecting ';' or '{' in ...

Post by onli » Sun Dec 15, 2019 2:50 pm

Hi. You might be in a bit of a catch-22 situation there, but the main issue is that the PHP version is too old. The version of Serendipity you want to install needs PHP 7.0 as the absolute minimum.

Stosh
Regular
Posts: 74
Joined: Mon Oct 12, 2009 11:47 pm

Re: Unsupported strict_types in... ---AND--- Syntax error, unexpected ':' expecting ';' or '{' in ...

Post by Stosh » Sun Dec 15, 2019 3:32 pm

Onli,

Thank you for your response.

Well that sucks on a variety of levels. Not the least of which is that I'm getting old and thought I had checked that. Also, it would seem that every new "version" of PHP is, for all intents and purposes a different programming language.

Are there earlier versions available that will get me far enough along that I can move the whole mess to the new hosting?

-djr

thh
Regular
Posts: 359
Joined: Thu Oct 26, 2006 2:38 pm
Location: Stuttgart, Germany
Contact:

Re: Unsupported strict_types in... ---AND--- Syntax error, unexpected ':' expecting ';' or '{' in ...

Post by thh » Sun Dec 15, 2019 4:52 pm

Stosh wrote:
Sun Dec 15, 2019 3:32 pm
Also, it would seem that every new "version" of PHP is, for all intents and purposes a different programming language.
That seems to be true, unfortunately, for all newer versions of PHP - i.e. they deprecate and remove quite a lot of language constructs, as it seems (from a bystander's point of view).
Stosh wrote:
Sun Dec 15, 2019 3:32 pm
Are there earlier versions available that will get me far enough along that I can move the whole mess to the new hosting?
Serendipity 2.3.x will need at least PHP 7.0 and has been tested for up to PHP 7.3 (at least in the core, not all plugins have been checked).

Serendipity 2.1.6, our last release in the 2.1 line, will run with PHP 5.3 to 5.6, I think.

You can donwload older releases linked from our download page: https://docs.s9y.org/downloads.html

Stosh
Regular
Posts: 74
Joined: Mon Oct 12, 2009 11:47 pm

Re: Unsupported strict_types in... ---AND--- Syntax error, unexpected ':' expecting ';' or '{' in ...

Post by Stosh » Sun Dec 15, 2019 5:25 pm

thh,

Thank you for that. I'll see if I can get my blogs back simply by copying an older version over them. If so, there may be a path yet left to follow. :)
-djr

Stosh
Regular
Posts: 74
Joined: Mon Oct 12, 2009 11:47 pm

Re: Unsupported strict_types in... ---AND--- Syntax error, unexpected ':' expecting ';' or '{' in ...

Post by Stosh » Sun Dec 15, 2019 7:07 pm

Just an update. . . Oh! and a question.

copying 2.1.6 over the existing files brought back the blog (one done, uploading the files to the other one now).

There were some problems with PHP obsolescence warnings in the "User Self Registration" plugin making a mess of the format, but upgrading the plugin fixed it.

It also replaced my slightly customized top page, but I'm sure I can figure out how to put that back.

I'm hoping this will be enough of an overlap to let me upgrade to the better hosting. We shall see.

Question
Is there a chart somewhere that shows which Serendipity versions are supported by which PHP versions?

Thanks for all your help.

-djr

thh
Regular
Posts: 359
Joined: Thu Oct 26, 2006 2:38 pm
Location: Stuttgart, Germany
Contact:

Re: Unsupported strict_types in... ---AND--- Syntax error, unexpected ':' expecting ';' or '{' in ...

Post by thh » Mon Dec 16, 2019 2:26 am

Stosh wrote:
Sun Dec 15, 2019 7:07 pm
QuestionIs there a chart somewhere that shows which Serendipity versions are supported by which PHP versions?
I don't think so.

The current installation requirements are shown in our documentation (see https://docs.s9y.org/docs/users/getting ... quirements), and we include new minimum PHP versions and compatibility to newer versions of PHP in our release announcements, see e.g. https://blog.s9y.org/archives/284-Seren ... eased.html or https://github.com/s9y/Serendipity/releases/tag/2.3.0 for 2.3.0 and https://blog.s9y.org/archives/261-Seren ... eased.html for 2.0.0 (new minimum version 5.3).

Post Reply