AMP plugins not working using php8
-
Hello @indoloto
AMP plugin has added support for PHP8, please check this Github issue to learn more about it.
[Fri Jul 30 15:31:19.893143 2021] [php:notice] [pid 26426] [client 162.158.167.235:28550] A PHP error occurred while trying to prepare the AMP response. This may not be caused by the AMP plugin but by some other active plugin or the current theme. You will need to review the error details to determine the source of the error. – unserialize(): Argument #1 ($data) must be of type string, AmpProject\\AmpWP\\RemoteRequest\\CachedResponse given (0) [TypeError]\n#0 /var/www/html/wp-content/plugins/amp/src/RemoteRequest/CachedRemoteGetRequest.php(116): unserialize()\n#1 /var/www/html/wp-content/plugins/amp/vendor/ampproject/amp-toolbox/src/RuntimeVersion.php(78): AmpProject\\AmpWP\\RemoteRequest\\CachedRemoteGetRequest->get()\n#2 /var/www/html/wp-content/plugins/amp/vendor/ampproject/amp-toolbox/src/Optimizer/Transformer/AmpRuntimeCss.php(163): AmpProject\\RuntimeVersion->currentVersion()\n#3 /var/www/html/wp-content/plugins/amp/vendor/ampproject/amp-toolbox/src/Optimizer/Transformer/AmpRuntimeCss.php(139): AmpProject\\Optimizer\\Transformer\\AmpRuntimeCss->inlineCss()\n#4 /var/www/html/wp-content/plugins/amp/vendor/ampproject/amp-toolbox/src/Optimizer/Transformer/AmpRuntimeCss.php(101): AmpProject\\Optimizer\\Transformer\\AmpRuntimeCss->addStaticCss()\n#5 /var/www/html/wp-content/plugins/amp/vendor/ampproject/amp-toolbox/src/Optimizer/TransformationEngine.php(65): AmpProject\\Optimizer\\Transformer\\AmpRuntimeCss->transform()\n#6 /var/www/html/wp-content/plugins/amp/src/Optimizer/OptimizerService.php(46): AmpProject\\Optimizer\\TransformationEngine->optimizeDom()\n#7 /var/www/html/wp-content/plugins/amp/includes/class-amp-theme-support.php(2046): AmpProject\\AmpWP\\Optimizer\\OptimizerService->optimizeDom()\n#8 /var/www/html/wp-content/plugins/amp/includes/class-amp-theme-support.php(1668): AMP_Theme_Support::prepare_response()\n#9 [internal function]: AMP_Theme_Support::finish_output_buffering()\n#10 /var/www/html/wp-includes/functions.php(4979): ob_end_flush()\n#11 /var/www/html/wp-includes/class-wp-hook.php(303): wp_ob_end_flush_all()\n#12 /var/www/html/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()\n#13 /var/www/html/wp-includes/plugin.php(470): WP_Hook->do_action()\n#14 /var/www/html/wp-includes/load.php(1097): do_action()\n#15 [internal function]: shutdown_action_hook()\n#16 {main}
@indoloto Thanks a lot for providing the helpful error message and stack trace. I’ve opened a bug to fix this in the next minor version: https://github.com/ampproject/amp-wp/issues/6505
Before that next minor version is released, we’ll have a pre-release build you can use.
@indoloto Do you by chance have a persistent object caching plugin active? I’m wondering if there is an issue with how it handles serialized data. I’m not able to reproduce the issue myself.
We have a fix that is in review: https://github.com/ampproject/amp-wp/pull/6506
I using newspaper theme from tagdiv with the default required newspaper plugins, yoast seo, wp fail2ban
I’ve merged the change that we believe will fix your issue.
You can test by installing the 2.1.x Production pre-release build linked to from our Development Builds Wiki page. Once installed it would show the plugin version as being
2.1.4-alpha-…
.Your testing would be very helpful.
thanks for the 2.1.x Production pre-release build, it’s working now
- The topic ‘AMP plugins not working using php8’ is closed to new replies.