Upload to CDN fails with PHP 8.0 but works with PHP 7.4
-
Hey there,
When I try uploading any website assets to Amazon S3, the upload fails (and attempts to retry every 10 seconds). This happens with PHP version 8.0.3, but when downgrading to PHP 7.4.16, the upload to S3 works as intended. Here’s what I get in the PHP-FPM error log (similar in Nginx, but less verbose in those logs):
thrown in /var/www/replaceddomain.com/public/content/plugins/w3-total-cache/lib/Aws/GuzzleHttp/Promise/RejectedPromise.php on line 16 [29-Apr-2021 07:28:34 UTC] PHP Fatal error: Uncaught TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given in /var/www/replaceddomain.com/public/content/plugins/w3-total-cache/lib/Aws/GuzzleHttp/Promise/RejectedPromise.php:16 Stack trace: #0 /var/www/replaceddomain.com/public/content/plugins/w3-total-cache/lib/Aws/GuzzleHttp/Promise/RejectedPromise.php(16): method_exists() #1 /var/www/replaceddomain.com/public/content/plugins/w3-total-cache/lib/Aws/Aws/Handler/GuzzleV6/GuzzleHandler.php(56): GuzzleHttp\Promise\RejectedPromise->__construct() #2 /var/www/replaceddomain.com/public/content/plugins/w3-total-cache/lib/Aws/GuzzleHttp/Promise/Promise.php(203): Aws\Handler\GuzzleV6\GuzzleHandler::Aws\Handler\GuzzleV6\{closure}() #3 /var/www/replaceddomain.com/public/content/plugins/w3-total-cache/lib/Aws/GuzzleHttp/Promise/Promise.php(156): GuzzleHttp\Promise\Promise::callHandler() #4 /var/www/replaceddomain.com/public/content/plugins/w3-total-cache/lib/Aws/GuzzleHttp/Promise/TaskQueue.php(47): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}() #5 /var/www/replaceddomain.com/public/content/plugins/w3-total-cache/lib/Aws/GuzzleHttp/Handler/CurlMultiHandler.php(98): GuzzleHttp\Promise\TaskQueue->run() #6 /var/www/replaceddomain.com/public/content/plugins/w3-total-cache/lib/Aws/GuzzleHttp/Handler/CurlMultiHandler.php(125): GuzzleHttp\Handler\CurlMultiHandler->tick() #7 /var/www/replaceddomain.com/public/content/plugins/w3-total-cache/lib/Aws/GuzzleHttp/Promise/Promise.php(246): GuzzleHttp\Handler\CurlMultiHandler->execute() #8 /var/www/replaceddomain.com/public/content/plugins/w3-total-cache/lib/Aws/GuzzleHttp/Promise/Promise.php(223): GuzzleHttp\Promise\Promise->invokeWaitFn() #9 /var/www/replaceddomain.com/public/content/plugins/w3-total-cache/lib/Aws/GuzzleHttp/Promise/Promise.php(267): GuzzleHttp\Promise\Promise->waitIfPending() #10 /var/www/replaceddomain.com/public/content/plugins/w3-total-cache/lib/Aws/GuzzleHttp/Promise/Promise.php(225): GuzzleHttp\Promise\Promise->invokeWaitList() #11 /var/www/replaceddomain.com/public/content/plugins/w3-total-cache/lib/Aws/GuzzleHttp/Promise/Promise.php(267): GuzzleHttp\Promise\Promise->waitIfPending() #12 /var/www/replaceddomain.com/public/content/plugins/w3-total-cache/lib/Aws/GuzzleHttp/Promise/Promise.php(225): GuzzleHttp\Promise\Promise->invokeWaitList() #13 /var/www/replaceddomain.com/public/content/plugins/w3-total-cache/lib/Aws/GuzzleHttp/Promise/Promise.php(62): GuzzleHttp\Promise\Promise->waitIfPending() #14 /var/www/replaceddomain.com/public/content/plugins/w3-total-cache/lib/Aws/Aws/AwsClientTrait.php(58): GuzzleHttp\Promise\Promise->wait() #15 /var/www/replaceddomain.com/public/content/plugins/w3-total-cache/lib/Aws/Aws/AwsClientTrait.php(77): Aws\AwsClient->execute() #16 /var/www/replaceddomain.com/public/content/plugins/w3-total-cache/CdnEngine_S3.php(177): Aws\AwsClient->__call() #17 /var/www/replaceddomain.com/public/content/plugins/w3-total-cache/CdnEngine_S3.php(145): W3TC\CdnEngine_S3->_upload() #18 /var/www/replaceddomain.com/public/content/plugins/w3-total-cache/CdnEngine_CloudFront.php(76): W3TC\CdnEngine_S3->upload() #19 /var/www/replaceddomain.com/public/content/plugins/w3-total-cache/Cdn_Core.php(196): W3TC\CdnEngine_CloudFront->upload() #20 /var/www/replaceddomain.com/public/content/plugins/w3-total-cache/Cdn_Core_Admin.php(257): W3TC\Cdn_Core->upload() #21 /var/www/replaceddomain.com/public/content/plugins/w3-total-cache/Cdn_AdminActions.php(121): W3TC\Cdn_Core_Admin->export_library() #22 /var/www/replaceddomain.com/public/content/plugins/w3-total-cache/Root_AdminActions.php(25): W3TC\Cdn_AdminActions->w3tc_cdn_export_library_process() #23 /var/www/replaceddomain.com/public/content/plugins/w3-total-cache/Generic_Plugin_Admin.php(165): W3TC\Root_AdminActions->execute() #24 /var/www/replaceddomain.com/public/wp-includes/class-wp-hook.php(292): W3TC\Generic_Plugin_Admin->load() #25 /var/www/replaceddomain.com/public/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters() #26 /var/www/replaceddomain.com/public/wp-includes/plugin.php(484): WP_Hook->do_action() #27 /var/www/replaceddomain.com/public/wp-admin/admin.php(237): do_action() #28 {main} thrown in /var/www/replaceddomain.com/public/content/plugins/w3-total-cache/lib/Aws/GuzzleHttp/Promise/RejectedPromise.php on line 16
Is W3TC compatible with PHP 8, or is this unexpected behavior? Thanks for your time!
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Upload to CDN fails with PHP 8.0 but works with PHP 7.4’ is closed to new replies.