Jump to content

Topic on Extension talk:GoogleLogin

ParseError: syntax error, unexpected 'static' (T_STATIC)

3
DestinationVenus (talkcontribs)

Getting this error after successful authentication.

Full stacktrace below.


Using:

MediaWiki version 1.37.2

PHP 7.4.28 (fpm-fcgi)

GoogleLogin: REL1_38 2022-08-31T06:12:06

I have found references to this sort of error as relating to a PHP version problem, but I don't want to jump into attempting to upgrade to PHP 8.1 as that may cause other problems. I have looked at earlier versions of the plugin but still see the keyword `static` used there. Not sure how to proceed. Any advice will be appreciated.


p.s. it may be relevant that I am not an experienced PHP developer (in case the solution is obvious to someone who is).

**************************

[148aa09dbbe238d574188361] /wiki/Special:UserLogin ParseError: syntax error, unexpected 'static' (T_STATIC)

Backtrace:

from /bitnami/mediawiki/extensions/GoogleLogin/vendor/psr/cache/src/CacheItemInterface.php(75)

#0 /opt/bitnami/mediawiki/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile()

#1 [internal function]: Composer\Autoload\ClassLoader->loadClass()

#2 /bitnami/mediawiki/extensions/GoogleLogin/vendor/google/auth/src/Cache/Item.php(29): spl_autoload_call()

#3 /opt/bitnami/mediawiki/vendor/composer/ClassLoader.php(571): include(string)

#4 /opt/bitnami/mediawiki/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile()

#5 [internal function]: Composer\Autoload\ClassLoader->loadClass()

#6 /bitnami/mediawiki/extensions/GoogleLogin/vendor/google/auth/src/Cache/MemoryCacheItemPool.php(62): spl_autoload_call()

#7 /bitnami/mediawiki/extensions/GoogleLogin/vendor/google/auth/src/Cache/MemoryCacheItemPool.php(45): Google\Auth\Cache\MemoryCacheItemPool->getItems()

#8 /bitnami/mediawiki/extensions/GoogleLogin/vendor/google/apiclient/src/AccessToken/Verify.php(194): Google\Auth\Cache\MemoryCacheItemPool->getItem()

#9 /bitnami/mediawiki/extensions/GoogleLogin/vendor/google/apiclient/src/AccessToken/Verify.php(105): Google\AccessToken\Verify->getFederatedSignOnCerts()

#10 /bitnami/mediawiki/extensions/GoogleLogin/vendor/google/apiclient/src/Client.php(814): Google\AccessToken\Verify->verifyIdToken()

#11 /bitnami/mediawiki/extensions/GoogleLogin/includes/Auth/GooglePrimaryAuthenticationProvider.php(414): Google\Client->verifyIdToken()

#12 /bitnami/mediawiki/extensions/GoogleLogin/includes/Auth/GooglePrimaryAuthenticationProvider.php(55): GoogleLogin\Auth\GooglePrimaryAuthenticationProvider->getVerifiedToken()

#13 /opt/bitnami/mediawiki/includes/auth/AuthManager.php(598): GoogleLogin\Auth\GooglePrimaryAuthenticationProvider->continuePrimaryAuthentication()

#14 /opt/bitnami/mediawiki/includes/specialpage/AuthManagerSpecialPage.php(374): MediaWiki\Auth\AuthManager->continueAuthentication()

#15 /opt/bitnami/mediawiki/includes/specialpage/AuthManagerSpecialPage.php(502): AuthManagerSpecialPage->performAuthenticationStep()

#16 /opt/bitnami/mediawiki/includes/htmlform/HTMLForm.php(718): AuthManagerSpecialPage->handleFormSubmit()

#17 /opt/bitnami/mediawiki/includes/specialpage/AuthManagerSpecialPage.php(435): HTMLForm->trySubmit()

#18 /opt/bitnami/mediawiki/includes/specialpage/LoginSignupSpecialPage.php(318): AuthManagerSpecialPage->trySubmit()

#19 /opt/bitnami/mediawiki/includes/specialpage/SpecialPage.php(647): LoginSignupSpecialPage->execute()

#20 /opt/bitnami/mediawiki/includes/specialpage/SpecialPageFactory.php(1366): SpecialPage->run()

#21 /opt/bitnami/mediawiki/includes/MediaWiki.php(314): MediaWiki\SpecialPage\SpecialPageFactory->executePath()

#22 /opt/bitnami/mediawiki/includes/MediaWiki.php(930): MediaWiki->performRequest()

#23 /opt/bitnami/mediawiki/includes/MediaWiki.php(564): MediaWiki->main()

#24 /opt/bitnami/mediawiki/index.php(53): MediaWiki->run()

#25 /opt/bitnami/mediawiki/index.php(46): wfIndexMain()

#26 {main}

103.158.43.34 (talkcontribs)

Hello! The issue is because a dependency, psr-cache is being upgraded with PHP8 type annotation. To make it work, you can simply remove all these annotations. For reference, you can change the file to this version: /php-fig/cache/blob/1802493cb2032e070c30d6dbe091ce7edf5d5231/src/CacheItemInterface.php on GitHub


(I could not paste the full link since the spam filter won't let me post, sorry)

202.131.176.10 (talkcontribs)

could you please elaborate on this. thank you

Reply to "ParseError: syntax error, unexpected 'static' (T_STATIC)"