Foxy Forum Status

We're no longer responding to questions via our forum, but we will keep it up for historical reasons. If you can't find the answer you're looking for, please visit our knowledge base or contact us. If there's enough interest in the future, we may bring the forum back.

Help with "Accessing the API with PHP" tutorial


I am trying to get an example built using the tutorial at There is a section titled "Set up our script" and it contains the follwong code:

require __DIR__ . '/vendor/autoload.php';

use GuzzleHttp\Client;
use GuzzleHttp\Subscriber\Cache\CacheSubscriber;
use Foxy\FoxyClient\FoxyClient;

$guzzle_config = array(
'defaults' => array(
'debug' => false,
'exceptions' => false
$guzzle = new Client($guzzle_config);
When I run this, I get the following message:

E_ERRORwith message "Uncaught Error: Class 'GuzzleHttpXSubscriberXCacheXCacheSubscriber' not found in my_foxyexample.php
Did my Composer install possibley miss something? I used:

php composer.phar require foxycart/foxyclient:~2.0
  • Tried

    find . -name CacheSubscriber.php -print
    in my vendor folder, but found nothing.
  • I tried also installing

    php composer.phar require guzzlehttp/guzzle
  • fc_adamfc_adam FoxyCart Team

    Sorry for the delay in getting back to you here.

    I believe the issue you're running into here is that our example code isn't compatible with the 2.0.X tags for the FoxyClient code. That uses an newer version of Guzzle (version 6) and that includes a different module for caching than the 1.0.X tags did with Guzzle 5 and CacheSubscriber.

    If you switch to requiring ~1.0, that should get the example code working. Alternatively, if you wanted to go with Guzzle v6, you can see information about the caching middleware here:
Sign In or Register to comment.