Bug #4602

memcache doesn't work

Added by Irene Höppner about 11 years ago. Updated about 10 years ago.

Must have
Start date:
Due date:
% Done:


PHP Version:
Has patch:


I tried to use memcache for parts of the cache.

Added the following configuration to Caches.yaml:

  backend: F3\FLW3\Cache\Backend\MemcachedBackend
    defaultLifetime: 0
    Servers: [localhost:11211]

This error occurs:

Fatal error: Call to a member function getScriptPathAndFilename() on a non-object in C:\Programme\xampp\htdocs\f3\intranet\Packages\Framework\FLOW3\Classes\Cache\Backend\MemcachedBackend.php on line 175

To check, wether the memcached-server is up and running, I used the following PHP-script:


$memcache = new Memcache;
$memcache->connect('localhost', 11211) or die ("Could not connect");

$version = $memcache->getVersion();
echo "Server's version: ".$version."<br/>\n";

$tmp_object = new stdClass;
$tmp_object->str_attr = 'test';
$tmp_object->int_attr = 123;

$memcache->set('key', $tmp_object, false, 10) or die ("Failed to save data at the server");
echo "Store data in the cache (data will expire in 10 seconds)<br/>\n";

$get_result = $memcache->get('key');
echo "Data from the cache:<br/>\n";



The result is:

Server's version: 1.2.1
Store data in the cache (data will expire in 10 seconds)
Data from the cache:
object(stdClass)#3 (2) { ["str_attr"]=> string(4) "test" ["int_attr"]=> int(123) }

Associated revisions

Revision 2f4303f9 (diff)
Added by Karsten Dambekalns about 11 years ago

[+BUGFIX] FLOW3 (Cache): Added missing dependency configuration for memcache and APC backends to Objects.yaml, fixes #4602.
[~TASK] FLOW3 (Cache): Fixed memcache (and APC) backend to use the cache identifier in their prefix in order to not overwrite entries from different caches having the same entry identifier. Tweaked Caches.yaml so it is possible to change the default cache backend to something with more options than the TransientMemoryBackend. Relates to #4602.


#1 Updated by Karsten Dambekalns about 11 years ago

  • Category set to Cache
  • Status changed from New to Accepted
  • Assignee set to Karsten Dambekalns
  • Target version set to 1.0 alpha 5

#2 Updated by Karsten Dambekalns about 11 years ago

First issue: Objects.yaml misses the dependencies for the backend, autowiring is off. Solved.
Next issue: Settings default options breaks with backends that don't support them... bah!

I'm at it...

#3 Updated by Karsten Dambekalns about 11 years ago

  • Status changed from Accepted to Resolved
  • % Done changed from 0 to 100

Applied in changeset r3210.

Also available in: Atom PDF