You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If W3 Total Cache is configured to use the Azure CDN provider, and if other installed plugins include the guzzlehttp/guzzle composer library v7.x or newer, a fatal error will be triggered when W3 Total Cache tries to load the older GuzzleHttp library. For example: PHP Fatal error: Cannot redeclare GuzzleHttp\describe_type() (previously declared in /var/www/html/wp-content/plugins/authorizer/vendor/guzzlehttp/guzzle/src/functions.php:16) in /var/www/html/wp-content/plugins/w3-total-cache/lib/Azure/GuzzleHttp/functions.php on line 41 https://github.com/guzzle/guzzle/blob/master/src/functions.php#L5-L19
Aloha, W3 Total Cache includes an older GuzzleHttp library (
v6.x
, I believe) as part of the Microsoft Azure Storage CDN provider:https://github.com/W3EDGE/w3-total-cache/tree/master/lib/Azure/GuzzleHttp
If W3 Total Cache is configured to use the Azure CDN provider, and if other installed plugins include the
guzzlehttp/guzzle
composer library v7.x or newer, a fatal error will be triggered when W3 Total Cache tries to load the older GuzzleHttp library. For example:PHP Fatal error: Cannot redeclare GuzzleHttp\describe_type() (previously declared in /var/www/html/wp-content/plugins/authorizer/vendor/guzzlehttp/guzzle/src/functions.php:16) in /var/www/html/wp-content/plugins/w3-total-cache/lib/Azure/GuzzleHttp/functions.php on line 41
https://github.com/guzzle/guzzle/blob/master/src/functions.php#L5-L19
The root cause is the conditional check for the
GuzzleHttp\uri_template
function infunctions_include.php
:https://github.com/W3EDGE/w3-total-cache/blob/master/lib/Azure/GuzzleHttp/functions_include.php#L4
Guzzle 7.x removed this function, so the conditional passes and tries to load the library, failing once it tries to redeclare the next function,
GuzzleHttp\describe_type
.This should be a quick fix in W3 Total Cache (unless you want to move the entire dependency into composer, but I assume that could have side effects). Just check
function_exists('GuzzleHttp\describe_type')
instead offunction_exists('GuzzleHttp\uri_template')
.https://github.com/W3EDGE/w3-total-cache/blob/master/lib/Azure/GuzzleHttp/functions_include.php#L4
For reference, the guzzle folks rolled out a similar fix in 7.0.1:
https://github.com/guzzle/guzzle/pull/2699/files
Thanks!
The text was updated successfully, but these errors were encountered: