Hello @bmunsch
Thank you for the support topic, Can you please re-install AMP plugin and check if you are still facing the issue.
Additionally please send your site health information using this form
This is the line in question: https://plugins.trac.wordpress.org/browser/amp/tags/2.2.2/vendor/composer/autoload_real.php#L32
\Composer\Autoload\ComposerStaticInitf6b2e7006ad3ce9b7d99b34b61a60ad1::getInitializer($loader)();
What version of PHP are you using?
It appears that the Composer autoloader introduced new syntax that is not supported in PHP 5.6. This can be seen here: https://3v4l.org/TKUqE
I can see the syntax here was changed when looking at the diff: https://plugins.trac.wordpress.org/changeset/2705296/#file150
I’m confused as to why this is the case since we included PHP 5.6 in the test matrix.
@bmunsch while we investigate further, the quick fix would be to update to PHP 7+. This is recommended regardless since PHP 5.6 is no longer being maintained and PHP 7 (and now PHP 8) are much faster.
Sure enough, when I try this build on a local environment running PHP 5.6 I also get an error.
I believe the issue is that the plugin was being built using PHP 5.6 on GitHub actions, and thus Composer was intentionally not using syntax which was not incompatible with PHP 5.6.
@milindmore22 I re-install plugin but I’ve got already an error.
@westonruter I use effectively PHP 5.6
Thanks you for your answers.
I’ve just published 2.2.3 which includes the PHP 5.6 fix.
@westonruter Thank you very much, version 2.2.3 works fine on PHP 5.6.
@westonruter The title of the topic should be changed to explain this error only appears with PHP 5.6
Thanks. I can’t change the topic title, but it should be clear to anyone who opens the topic.
For, me I get the same error for autoload_real.php row 32. The error is in another language, but it translates to E_PARSE. Error message: syntax error, unexpected ‘(‘
When I go to phpMyAdmin, it clearly says:
– PHP:n version: 7.3.33
– cpsrvd 11.100.0.12
– libmysql – 5.6.43
Why is it happening also with PHP 7.3.33? (It breaks my site so that I can’t access it, recovery mode doesn’t let me in either.) Thanks.
@distill
Make sure you are using latest AMP plugin version (2.2.4), Please create a new support topic, also please share your site health info using this form