Support » Plugin: W3 Total Cache » Getting PHP Fatal Error upon using export to cdn buttons

  • Resolved midnitedev

    (@midnitedev)


    I’m getting an error upon using export buttons to cdn on W3 Total Cache Plugin (wp-includes, theme files, custom files). When I checked the debug.log, I’m getting these errors:

    PHP Fatal error:  Uncaught Error: Call to undefined method GuzzleHttp\Utils::chooseHandler() in /var/app/current/vendor/guzzlehttp/guzzle/src/functions.php:61
    Stack trace:
    #0 /var/app/current/wp-content/plugins/w3-total-cache/vendor/guzzlehttp/guzzle/src/HandlerStack.php(42): GuzzleHttp\choose_handler()
    #1 /var/app/current/wp-content/plugins/w3-total-cache/vendor/guzzlehttp/guzzle/src/Client.php(65): GuzzleHttp\HandlerStack::create()
    #2 /var/app/current/wp-content/plugins/w3-total-cache/vendor/aws/aws-sdk-php/src/Handler/GuzzleV6/GuzzleHandler.php(26): GuzzleHttp\Client->__construct()
    #3 /var/app/current/vendor/aws/aws-sdk-php/src/functions.php(279): Aws\Handler\GuzzleV6\GuzzleHandler->__construct()
    #4 /var/app/current/wp-content/plugins/w3-total-cache/vendor/aws/aws-sdk-php/src/ClientResolver.php(652): Aws\default_http_handler()
    #5 /var/app/current/wp-content/plugins/w3-total-cache/vendor/aws/aws-sdk-php/src/ClientResolver.php(295): Aws\ClientResolver::_default_handler(Array)
    #6 /var/app/current/wp-content/plugins/w3-total-ca in /var/app/current/vendor/guzzlehttp/guzzle/src/functions.php on line 61

    These are the errors seen on debug.log everytime I click these buttons and I get this on the export windows:

    Total files:	605
    Processed:	0
    Status:	request failed (retry in 4s)
    Time elapsed:	6s
    Last response:	8:33:50 PM 7/8/2021

    So it seems I’m unable to export the files to the cdn due to this. I need some help in trying to resolve this and help would greatly be appreciated.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Marko Vasiljevic

    (@vmarko)

    Hello @midnitedev

    I am sorry about the issue you are experiencing and I am happy to assist you with this.
    Can you please check if you are using any other plugin that is using the AWS SDK, try to disable it, and see if the issue persists?
    Thanks!

    Thread Starter midnitedev

    (@midnitedev)

    Hi Marko,

    None that I know of. However, I’m using this on my functions.php file since I installed aws-sdk via composer (and using the following lines below based on documentation aws):

    require ABSPATH.'vendor/autoload.php';
    use Aws\S3\S3Client;
    use Aws\Exception\AwsException;

    Previously, we had these lines of code, which was replaced by the one above because it was causing a server 500 error when it was uncommented.

    //import aws sdk
    //     require_once ABSPATH."aws-sdk/aws-autoloader.php";

    where aws-sdk was an unzipped version of aws-sdk until using the Composer-installed version.

    Plugin Support Marko Vasiljevic

    (@vmarko)

    Hello @midnitedev

    Thank you for the information.
    We tried to limit the number of requests when the W3 Total Cache loads AWS library and it happens only when interactions with AWS are required.
    In this case, it seems that there is a conflict because W3TC is trying to load the library
    There is an option to force both projects to use the same AWS library code.
    you should include AWS separately, and force W3TC not to load its own copy by adding
    define('W3TC_SKIPLIB_AWS', true);
    I hope this helps!
    Thanks!

    Thread Starter midnitedev

    (@midnitedev)

    @vmarko

    The solution has worked! I’m now able to upload theme files, custom, etc. to CDN. Thanks.

    Plugin Support Marko Vasiljevic

    (@vmarko)

    Hello @midnitedev

    You are most welcome!

    We would really appreciate it if you could take a minute and post a review here. This will help us to continue offering a top-notch product to users.
    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Getting PHP Fatal Error upon using export to cdn buttons’ is closed to new replies.