phpfastcache: Class 'phpFastCache\Drivers\Memcache\Driver' not found

Configuration:

PhpFastCache version: 6.0.2 (Edited by @Geolim4) PHP version: 5.5.35 Operating system: Mac OS X

Issue description:

I’m trying to include phpfastcache without Composer, so I just copy the code from docs/examples/withoutComposer.php, but requiring CacheManager.php like so:

require(DOCUMENT_ROOT."/private/modules/phpFastCache/CacheManager.php");
use phpFastCache\CacheManager;

$InstanceCache = CacheManager::getInstance('memcache');

/**
 * Try to get $products from Caching First
 * product_page is "identity keyword";
 */
$key = "product_page";
$CachedString = $InstanceCache->getItem($key);

if (is_null($CachedString->get())) {
    //$CachedString = "APC Cache --> Cache Enabled --> Well done !";
    // Write products to Cache in 10 minutes with same keyword
    $CachedString->set("Memcache Cache --> Cache Enabled --> Well done !")->expiresAfter(5);
    $InstanceCache->save($CachedString);

    echo "FIRST LOAD // WROTE OBJECT TO CACHE // RELOAD THE PAGE AND SEE // ";
    echo $CachedString->get();

} else {
    echo "READ FROM CACHE // ";
    echo $CachedString->get();
}

echo '<br /><br /><a href="/">Back to index</a>&nbsp;--&nbsp;<a href="./' . basename(__FILE__) . '">Reload</a>';

FYI: DOCUMENT_ROOT is a global variable for $_SERVER['DOCUMENT_ROOT'].

The only thing printed in my page is:

Fatal error: Class 'phpFastCache\Drivers\Memcache\Driver' not found in /Applications/XAMPP/xamppfiles/htdocs/cache_test/private/modules/phpFastCache/CacheManager.php on line 218

Where may be the problem? Thanks for your time.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 16 (11 by maintainers)

Most upvoted comments

@Geolim4 Sorry, I just left the office. I’ll check tomorrow. Please don’t close it!

Warning: The V6 is not intended to work with php 5.5, downgrade to phpFastCache v5 or upgrade your php to 5.6 at least for the v6 😃